<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Surya Sure on Medium]]></title>
        <description><![CDATA[Stories by Surya Sure on Medium]]></description>
        <link>https://medium.com/@suryasure734?source=rss-3213a50aa3d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k_cPKwG1uitdavYgv75aLA.jpeg</url>
            <title>Stories by Surya Sure on Medium</title>
            <link>https://medium.com/@suryasure734?source=rss-3213a50aa3d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 02:55:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@suryasure734/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating a Chatbot with PyTorch]]></title>
            <link>https://studentsxstudents.com/creating-a-chatbot-with-pytorch-495622d77481?source=rss-3213a50aa3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/495622d77481</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[enjoy-writing]]></category>
            <category><![CDATA[miscellaneous]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Surya Sure]]></dc:creator>
            <pubDate>Sat, 17 Dec 2022 20:52:39 GMT</pubDate>
            <atom:updated>2022-12-19T14:42:29.356Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever used the internet, you most likely have come across a chatbot.</p><p>Chatbots are computer programs designed to simulate conversation with human users, especially over the Internet. They can be integrated into messaging apps, websites, mobile apps, and other platforms.</p><p>Chatbots are used for a variety of purposes, including customer service, information gathering, and entertainment. Some chatbots are programmed to answer questions and provide information to users, while others are designed to facilitate transactions or help users with tasks such as booking a hotel room or ordering food.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WXzDD6YbbjWDpVwS.png" /></figure><p>How exactly do these chatbots work though? If they were programmed to only respond to one specific sentence, that wouldn’t work because most customers will probably write the sentence in a different way.</p><p>This means it would have to be programmed to understand multiple iterations of the same sentence.</p><p>How could we do that? Well, one idea that comes to mind is typing every possible iteration of one sentence. But this won’t work for two reasons:</p><ol><li>It’s inefficient. A sentence could be written in hundreds of different ways and thinking of each one would be very time-consuming. Also, most chatbots will need to be able to understand multiple sentences, so we would need to think of thousands of iterations.</li><li>We won’t be able to cover all iterations. Although we can cover some of them, there will likely be many more iterations that we completely miss, simply due to the complexity of the English language.</li></ol><p>So what we need to do is program the chatbot to understand multiple iterations without actually writing down every single iteration.</p><p>How can we do this? With the help of machine learning (ML).</p><p>Chatbots use artificial intelligence and machine learning techniques to understand and interpret user input, and they can use natural language processing to generate appropriate responses. Many chatbots are able to learn and adapt over time, improving their ability to understand and interact with users.</p><p>I was able to build my own chatbot for customer inquiry with ML and I’ll show you how.</p><p>At a high level, here’s what I did:</p><ol><li>I created a file containing the data I’ll train the chatbot on. It contains different iterations of sentences for different categories. For example, under the category “greeting”, I have “Hi”, “Hey”, “How are you”, “Is anyone there?”, “Hello”, “Good day”. I have multiple categories like this. The categories are called tags and each potential input has an associated tag. The data also contains different sets of responses for each tag.</li><li>I preprocess the data and use a bag-of-words model to create multiple vectors with the same dimensions to represent each input.</li><li>I pass each vector through a 3-layer feedforward neural network, where the output is the predicted tag of the vector, or in other words, the predicted category of the sentence. The chatbot then chooses a random response from its set of responses associated with the predicted tag.</li></ol><p>If you understood all of that, you can skip to the implementation part. If you didn’t here’s a deeper explanation.</p><h3>Natural Language Processing</h3><p>Natural language processing (NLP) is a field of artificial intelligence that focuses on enabling computers to understand, interpret, and generate human language. It involves developing algorithms and models that can analyze and manipulate human language data.</p><p>NLP has a wide range of applications, including language translation, text summarization, sentiment analysis, and chatbot development. An example of NLP that you use every day is Google Search. Google takes the keywords in your request and searches the internet for matching resources. Other examples include Google Translate, Grammarly, and the most advanced application, <a href="https://chat.openai.com/chat">ChatGPT</a>.</p><p>NLP algorithms and models are trained on large datasets of human language data and use techniques such as machine learning and deep learning to recognize patterns and make informed decisions. This is exactly how chatbots function. They’re provided with a set of customer requests and corresponding responses. They’re then trained on this data and are able to recognize similar sentences to the ones they’re trained on.</p><p>You might be wondering how computers understand words. They don’t. They convert words and sentences into arrays of numbers. Here’s how.</p><h3>Bag of Words Model</h3><p>The bag of words model is a way of representing text data as numbers. It involves converting a collection of text documents into numerical feature vectors that can be input into an ML model.</p><p>To create a bag of words model, the text is first preprocessed to remove unwanted characters and words, such as punctuation and stop words. Then, an array of words is created by selecting a set of words that appear most frequently in the text. In our case, the array will contain all words from our data, since it’s a relatively small amount of data. Each sentence is then represented as a numerical vector, with each element of the vector corresponding to a word in the vocabulary. The value of each element in the vector determines whether the word is frequently used or not.</p><p>Here’s an example:</p><p>Let’s say our dataset of customer input contains the following inputs: <br>“Hi”, “How are you?”, “Bye”, and “See you later”.</p><p>The set of all words would contain “Hi”, “How” “are”, “you”, “bye”, “see”, and “later”. Note that we don’t repeat words. The word vector would look like this: [“Hi”, “How”, “are”, “you”, “bye”, “see”, “later”].</p><p>If we use the bag of words model here, we would create four vectors with the same dimensions, since we have four inputs. Here’s how we would do it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aS3llZEY9Iph339OjoimRg.png" /><figcaption>Source: <a href="https://www.youtube.com/watch?v=RpWeNzfSUHw">https://www.youtube.com/watch?v=RpWeNzfSUHw</a></figcaption></figure><p>We first make four vectors with the same dimensions as the “all words” vector. All vectors contain zeros at first. Then, for each vector, we change every element corresponding to a word that’s present in the “all words” vector to “1”. This creates a unique vector to represent each sentence.</p><p>Now that we have all of our sentences as vectors, we’re ready to train them with the neural network.</p><h3>Feedforward Neural Network</h3><p>Now it’s time to input our vectors into a neural network and get our chatbot functioning.</p><p>If you’ve never seen or heard of neural networks, here’s a high-level explanation:</p><ol><li>An NN takes in input and provides an output. Think of it as a function. These outputs are generally some sort of prediction.</li><li>There are three types of layers: an input layer, an output layer, and a hidden layer. Input and output layers are pretty obvious. A hidden layer takes the input of the previous layer and applies an activation function (something that changes the value). There can be multiple hidden layers in one network.</li><li>Once we get a prediction, we compare it to the correct value to see how close it is. If the difference between the two is high, we reduce the error. We repeat this process and constantly reduce the error until it’s relatively low. This process is called gradient descent.</li></ol><figure><img alt="How to Build and Train Your First Neural Network – Towards AI" src="https://cdn-images-1.medium.com/proxy/1*HByuNjKgdVf9LaV_g4fZzA.png" /></figure><p>Since I could write a whole article on just neural networks, I’m not gonna go in-depth right now. If you want to learn more about them (which I highly recommend), here are some good resources:</p><ul><li>Use <a href="https://youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi">this</a> if you’re comfortable with calculus</li><li>Use <a href="https://youtube.com/playlist?list=PLqgr5FD_y_wLYetqEkzc68eReW2gHK14Q">this</a> if you want to learn the basics, including the math</li></ul><p>For this project, I used a 3-layer feedforward neural network, with 1 hidden later. For each layer, I used the ReLU activation function.</p><h3>Implementation</h3><p>Now that I explained the key concepts, here’s how I built it out.</p><h4>Defining Functions</h4><pre>from re import A<br>import nltk<br>import numpy as np<br>##nltk.download(&#39;punkt&#39;)<br>from nltk.stem.porter import PorterStemmer<br>stemmer = PorterStemmer()<br><br>def tokenize(sentence):<br>    return nltk.word_tokenize(sentence)<br><br>def stem(word):<br>    return stemmer.stem(word.lower())</pre><p>As with any NLP application, we have to first preprocess the data. First, I’m creating a function to tokenize the sentences, which separates each word in the sentence and turns the sentence into a list of words. Then, I’m creating a function to stem the words, which removes any suffixes such as “ly”, “er”, “s”, etc. This turns the word into its root form. I’ll call these functions later on.</p><pre>def bag_of_words(tokenized_sentence, all_words):<br><br>    tokenized_sentence = [stem(w) for w in tokenized_sentence]<br><br>    bag = np.zeros(len(all_words), dtype=np.float32)<br>    for idx, w in enumerate(all_words):<br>        if w in tokenized_sentence:<br>            bag[idx] = 1.0<br><br>    return bag</pre><p>I‘m writing another function to implement the bag of words model. Essentially, I create an array with the same dimensions as the list of tokenized words and fill it with zeros. Then, I turn the corresponding element of any word that appears in the sentence into a 1. I’ll also call this function later.</p><p>I put all the functions above in a separate file to make it easier to follow my code.</p><h4>Creating the Model</h4><p>I’m now creating the feedforward neural network. I stored this code in a separate file and called it model.py. I’m doing this to keep my work more organized.</p><pre>import torch<br>import torch.nn as nn<br><br># creating the neural network that we&#39;ll use to train the data<br>class NeuralNet(nn.Module):<br>    def __init__(self, input_size, hidden_size, num_classes):<br>        super(NeuralNet, self).__init__()<br>        self.l1 = nn.Linear(input_size, hidden_size) <br>        self.l2 = nn.Linear(hidden_size, hidden_size) <br>        self.l3 = nn.Linear(hidden_size, num_classes)<br>        self.relu = nn.ReLU()<br>    <br>    def forward(self, x):<br>        out = self.l1(x)<br>        out = self.relu(out)<br>        out = self.l2(out)<br>        out = self.relu(out)<br>        out = self.l3(out)<br>        # no activation and no softmax at the end<br>        return out</pre><p>There, we’re done. Pretty simple right? When we’re implementing a NN on the computer, we don’t need to think or worry about the math. It does everything for us.</p><p>In the first function, I define each layer and its properties and essentially create the NN. I want to use three layers, so I have one input, one hidden, and one output. I also define the activation function that I’ll use throughout the model.</p><p>In the second function, I’m passing the inputs through the NN. Every output is passed through the ReLU function before going to the next layer to keep all values positive. Note that I don’t have an activation function at the end. This is because I’ll use it later when we call the model.</p><h4>Preprocessing</h4><pre>import json<br>from nltk_utils import tokenize, stem, bag_of_words<br>import numpy as np<br>import torch<br>import torch.nn as nn<br>from torch.utils.data import Dataset, DataLoader<br>from model import NeuralNet<br><br>with open(&#39;intents.json&#39;, &#39;r&#39;) as f:<br>    intents = json.load(f)<br><br>all_words = []<br>tags = []<br>xy = []<br>for intent in intents[&#39;intents&#39;]:<br>    tag = intent[&#39;tag&#39;]<br>    tags.append(tag)<br>    for pattern in intent[&#39;patterns&#39;]:<br>        w = tokenize(pattern)  # tokenizing all words in the patterns (potential questions)<br>        all_words.extend(w)  # we use extend instead of append because pattern is already an array and we don&#39;t want to put an array in an array<br>        xy.append((w, tag))<br>    <br>ignore_words = [&#39;?&#39;, &#39;!&#39;, &#39;.&#39;, &#39;,&#39;]<br>all_words = [stem(w) for w in all_words if w not in ignore_words] #stemming all the words and ignoring punctuation <br>all_words = sorted(set(all_words))  # using set() removes duplicate elements<br>tags = sorted(set(tags))  #adds unique labels (not necessary but do it in to be safe) </pre><p>Now, I’m calling the functions I created above and organizing the data. I’m tokenizing, stemming, and removing punctuation marks and duplicate words from the dataset to remove any unwanted elements.</p><h4>Creating the Dataset</h4><pre>X_train = []<br>y_train = []<br>for (pattern_sentence, tag) in xy:<br>    bag = bag_of_words(pattern_sentence, all_words) <br>    X_train.append(bag)<br><br>    label = tags.index(tag)<br>    y_train.append(label) #cross entropy loss<br>    <br>X_train = np.array(X_train)<br>y_train = np.array(y_train)</pre><p>I’m now creating my training inputs and outputs. The training input array will contain the arrays that are generated after passing the data in the intents.json file through the bag of words model. The training output (or labels) will contain the corresponding tag of each input. I’m converting the lists to arrays since all of our other operations will use arrays.</p><pre>class ChatDataset(Dataset):<br>    def __init__(self):<br>        self.n_samples = len(X_train)<br>        self.x_data = X_train<br>        self.y_data = y_train<br><br>    #dataset[idx]<br>    def __getitem__(self,index):<br>        return self.x_data[index], self.y_data[index]<br><br>    def __len__(self):<br>        return self.n_samples</pre><p>Now I’m creating a class that contains the entire training dataset. I’m defining variables and creating functions in this class to make it easy to use features from the dataset. You don’t have to do this, but it makes any potential debugging a lot easier.</p><h4>Training the Data</h4><pre>batch_size = 8<br>hidden_size = 8<br>output_size = len(tags)<br>input_size = len(X_train[0])<br>learning_rate = 0.001<br>num_epochs = 100</pre><p>Setting up some parameters that’ll be used in the neural network. Input and output sizes are pretty self-explanatory. Batch size is the number of samples (inputs) that will be passed through the NN at one time. There are multiple iterations to pass all of the samples through the NN, since the computer won’t be able to handle passing all of them at once. An epoch is when all samples are passed through the NN once. I have 100 epochs, which means all of the samples will be passed through the NN 100 times. The learning rate is the rate at which the model will reduce the error by. A smaller learning rate means the model will take smaller steps and vice-versa. I used 0.001 because I found it to be optimal for this specific model.</p><p>Note: You can adjust these hyperparameters to best suit your model.</p><pre>dataset = ChatDataset()<br>train_loader = DataLoader(dataset = dataset, batch_size = batch_size, shuffle = True, num_workers = 0)<br><br>device = torch.device(&#39;cuda&#39; if torch.cuda.is_available() else &#39;cpu&#39;)<br>model = NeuralNet(input_size, hidden_size, output_size).to(device)<br>    <br>#Loss and optimizer<br>criterion = nn.CrossEntropyLoss()<br>optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate)</pre><p>Here I’m initializing the dataset and model. I’m calling the dataset and model classes I defined earlier and assigning them to a variable. I’m also creating variables to find the error and optimize the model. I’m using cross-entropy loss because it’s simple and works for our purposes.</p><pre>for epoch in range(num_epochs):<br>    for (words, labels) in train_loader:<br>        words = words.to(device)<br>        labels = labels.to(dtype=torch.long).to(device)<br><br>        # forward<br>        outputs = model(words)<br>        loss = criterion(outputs, labels)<br><br>        #backward and optimizer step<br>        optimizer.zero_grad()<br>        loss.backward()<br>        optimizer.step()<br><br>    if (epoch +1) % 100 == 0:<br>        print(f&#39;Epoch [{epoch+1}/{num_epochs}], Loss: {loss.item():.4f}&#39;)<br><br>print(f&#39;final loss, loss={loss.item():.4f}&#39;)</pre><p>This part’s pretty simple — I’m just passing the data through the neural network. I’m then doing gradient descent and minimizing the error. I run this over 100 epochs and print the final error, which should be really small.</p><h4>Running the Model</h4><pre>input_size = data[&quot;input_size&quot;]<br>hidden_size = data[&quot;hidden_size&quot;]<br>output_size = data[&quot;output_size&quot;]<br>all_words = data[&#39;all_words&#39;]<br>tags = data[&#39;tags&#39;]<br>model_state = data[&quot;model_state&quot;]<br><br>model = NeuralNet(input_size, hidden_size, output_size).to(device)<br>model.load_state_dict(model_state)<br>model.eval()<br><br>bot_name = &quot;Sam&quot;<br>print(&quot;Let&#39;s chat! (type &#39;quit&#39; to exit)&quot;)<br>while True:<br>    sentence = input(&quot;You: &quot;)<br>    if sentence == &quot;quit&quot;:<br>        break<br><br>    sentence = tokenize(sentence)<br>    X = bag_of_words(sentence, all_words)<br>    X = X.reshape(1, X.shape[0])<br>    X = torch.from_numpy(X).to(device)<br><br>    output = model(X)<br>    _, predicted = torch.max(output, dim=1)<br><br>    tag = tags[predicted.item()]<br><br>    probs = torch.softmax(output, dim=1)<br>    prob = probs[0][predicted.item()]<br>    if prob.item() &gt; 0.75:<br>        for intent in intents[&#39;intents&#39;]:<br>            if tag == intent[&quot;tag&quot;]:<br>                print(f&quot;{bot_name}: {random.choice(intent[&#39;responses&#39;])}&quot;)<br>    else:<br>        print(f&quot;{bot_name}: I do not understand...&quot;)</pre><p>This is almost the same as training the file. I define parameters, apply the bag of words model, and run the input data through the model. However, there are some differences.</p><p>First, I’m creating a “while” loop to keep the conversation going, similar to a regular chatbot. Then, after receiving the outputs, I put them through a softmax function, which converts the values into probabilities relative to all the other values. If the probability of one of the outputs is above 75%, it chooses the corresponding tag. If everything is below 75%, it tells you that it didn’t understand, which likely means you typed something unrelated to the topic you’re discussing.</p><h4>Output</h4><p>If everything worked, you should be seeing this in your output terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*vLP-1wq3w27y2q7QWm5_Aw.png" /></figure><p>That’s it! The chatbot is built. Now I can customize the intents.json file to make the chatbot serve any purpose I want.</p><p>Here’s the original tutorial I followed to build this:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLqnslRFeH2UrFW4AUgn-eY37qOAWQpJyg&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLqnslRFeH2UrFW4AUgn-eY37qOAWQpJyg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FRpWeNzfSUHw%2Fhqdefault.jpg%3Fsqp%3D-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ%3D%3D%26rs%3DAOn4CLA-uqKqn3dCz0GAqDLsB-75sJ-QRg%26days_since_epoch%3D19343&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="853" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/73d8a92aae429c1bf2d4e57d96d1e141/href">https://medium.com/media/73d8a92aae429c1bf2d4e57d96d1e141/href</a></iframe><p>If you want to see all of the code, here’s my GitHub repo:</p><p><a href="https://github.com/SurjaHead/Chatbot-with-PyTorch">GitHub - SurjaHead/Chatbot-with-PyTorch: Chatbot created with Python and Pytorch.</a></p><p><em>If you liked this, and want to see more of my content, consider following me on </em><a href="https://medium.com/@suryasure734"><strong>Medium</strong></a> <em>and </em><a href="https://www.linkedin.com/in/surya-sure-9ba9b2220/"><strong>LinkedIn</strong></a><strong>. </strong><em>If you have any questions, feel free to shoot me an email at </em><strong>suryasure734@gmail.com</strong><em>, or send me a message on </em><a href="https://twitter.com/SuryaSure08"><strong>Twitter</strong></a><em>.</em><strong> </strong><em>If you want to follow my journey, you can subscribe to my quarterly </em><a href="https://suryasure.substack.com/?utm_source=%2Fprofile%2F49603877-surya-sure&amp;utm_medium=reader2&amp;utm_campaign=substack_profile&amp;sort=new"><strong>Newsletter</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=495622d77481" width="1" height="1" alt=""><hr><p><a href="https://studentsxstudents.com/creating-a-chatbot-with-pytorch-495622d77481">Creating a Chatbot with PyTorch</a> was originally published in <a href="https://studentsxstudents.com/">students x students</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sentiment Analysis of Movie Reviews Using NLP]]></title>
            <link>https://studentsxstudents.com/sentiment-analysis-of-movie-reviews-using-nlp-c15911e48092?source=rss-3213a50aa3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c15911e48092</guid>
            <category><![CDATA[nltk]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[sentiment-analysis]]></category>
            <dc:creator><![CDATA[Surya Sure]]></dc:creator>
            <pubDate>Wed, 14 Dec 2022 22:04:29 GMT</pubDate>
            <atom:updated>2023-01-02T20:50:55.388Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Note: You will need a basic understanding of Python functions and classes to follow this article.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mpsB8OoqM7zTggH6.jpg" /></figure><p>Natural Language Processing (NLP) is a subset of Machine Learning (ML) that deals with understanding and generating text. This includes functions such as summarization, answering questions, translating text, and classifying text. We use these functions in our daily lives without realizing it. For example, Google uses NLP to power its search engine. The engine searches the internet for websites and pages that contain the same words as your search. It can also identify questions, which it provides answers to, without making you go to another website.</p><p>Clearly, this is a relatively advanced use of NLP. It’s not something you’ll be able to build when you’re first starting to learn NLP. Luckily, there are some other projects that you can build to get some hands-on experience with NLP. Sentiment analysis is one of those projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*PYyuSDgHpaC_lZyJ.jpg" /></figure><p>A sentiment analysis program classifies text as either positive or negative, based on the keywords used in the text. Usually, it’s trained on a dataset containing either clearly positive or negative text. It’s not gonna be 100% accurate, but it’s a fun project to build to get comfortable with some NLP libraries.</p><p>I built a sentiment analysis program for movie reviews, using NLTK, one of the most common python libraries for simple NLP projects. I’ll explain each section of my code and the logic behind it, but if you want to see all of my code put together, you can check out my <a href="https://github.com/SurjaHead/SentimentAnalysis">GitHub repo</a>.</p><h3>NLP Terminology</h3><p>Before we get to the code, I want to explain some terminology that I’ll use throughout the article. These are mostly names for different types of operations in NLP used to preprocess the data (aka making it easier for machines to deal with).</p><p>These are the processes/terms used in this program:</p><ul><li><strong>Corpus:</strong> A body of text. The plural is corpora.</li><li><strong>Stemming: </strong>Reducing a word down to its root. Basically, we remove any suffix on the word such as “er”, “ly”, “s”, etc. This makes it easier for the computer to relate similar words to each other.</li><li><strong>Tokenizing:</strong> Breaking down a corpus into individual words. There’s also sentence tokenizing, where a paragraph is broken down into sentences, but I’ll be using work tokenizing for this task.</li><li><strong>Part of Speech (POS) Tagging:</strong> Assigning each word in a corpus its part of speech. This is used to isolate or remove certain types of words.</li></ul><p>These are some terms that aren’t used in this program, but are still commonly used in NLP:</p><ul><li><strong>Named Entity Recognition (NER): </strong>The process of identifying named entities and labeling them. Some examples: identifying the White House as a government building, identifying Donald Trump as a person, or identifying the United States of America as a country.</li><li><strong>Lemmatizing:</strong> Similar to stemming, but returns synonyms of the word and the root form of the word.</li><li><strong>Stop Words: </strong>Filler words that don’t add much to the sentence. These are generally removed to reduce the size of the data we’re dealing with. Some examples are “to”, “so”, “my”, etc. Here’s a <a href="https://gist.github.com/sebleier/554280">full list</a> of stopwords in NLTK.</li></ul><h3>Code Breakdown</h3><p>Okay, enough of the explanation, let’s get to implementing it!</p><h3>Imports</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZxOBa6vszcAdJdf8gH4-Q.png" /></figure><p>First, I’m importing all of the libraries I’ll be using. As you can see, NLTK and SciKitLearn (SKLearn) are the main libraries I’ll be using. From NLTK, I’m importing the movie_reviews text file, which contains over 10,000 positive and negative reviews. This will be the data I’ll be using for both training and testing. From SKLearn, I’m importing several classifiers to perform their classifications of the data, so that we reduce the potential bias of only using one classifier.</p><h3>Classifier Votes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EYjTVO8ALARHqEVHyvMYLw.png" /></figure><p>Now I’m, creating a class that allows the classifiers to vote, which I’ll be calling near the end. Essentially, this class takes in several classifiers as inputs, allows them to vote either “positive” or “negative”, and returns a confidence score that indicates what percent of the classifiers voted for the majority.</p><p>The classify function passes the input features (the reviews) through the function and adds the classification of each review by each classifier to an empty list.</p><p>Then, the confidence function counts the number of occurrences of the mode of the votes and divides that by the total number of votes to return what percent of classifiers voted for the majority.</p><h3>Word Tokenizing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-MV_EFtIvmWjBzwkB0PTrw.png" /></figure><p>This section is to separates each adjective and puts individual reviews into either a positive or negative list, based on the labeling of the review.</p><p>First, I’m creating two variables for positive and negative reviews and storing the data from the respective files in those variables. Then, I use part—of—speech tagging to only allow adjectives to be used, since other words don’t necessarily tell us whether a review is positive or negative.</p><p>Using a “for” loop, I separate the positive reviews file into individual reviews and add them to the empty “documents” list. Then, I tokenize the positive reviews and add the words to the “all_words” list if it’s an adjective. I repeat this process for the negative reviews as well.</p><p>So now, we have a “documents” list with each review that is tagged with “pos” or “neg” to indicate whether the review is positive or negative, and we have an “all_words” list that contains all adjectives from the reviews.</p><h3>Organizing the Data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7114Y7WrFXmdRNumjX4hw.png" /></figure><p>Now, I’m setting up the training and testing data. I’m using a function to separate each word in each review and output the top 3000 words. Then I’m creating a tuple with each word and a True or False value attached to it to indicate whether or not it’s one of the most common 3000 words. Then, I’m shuffling the date and printed the number of reviews. Finally, I’m creating my training dataset with the first 10000 reviews, and my testing set with the last 664 reviews.</p><h3>Classifying the Data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rN3zPfUJF0o_V0iQ_hZzQg.png" /></figure><p>This is the last step of the process, where I’m training each of my classifiers with the training data and then passing my testing data through the classifiers to check my results. Then, I print an accuracy score to check how accurate the models were. Here’s the code for the first classifier, in case you’re having trouble seeing the code:</p><pre>classifier = nltk.NaiveBayesClassifier.train(training_set)<br>print(&#39;Naive Bayes Algo accuracy percent&#39;, (nltk.classify.accuracy(classifier, testing_set))*100)<br>classifier.show_most_informative_features(15)</pre><p>This same code block is repeated for all of the other classifiers, but with different classifiers in place of the “NaiveBayesClassifier”. However, in the first block, I’m printing the 15 most frequently used words and whether they are positive or negative in the last line. I don’t do this in the code for other classifiers.</p><h3>Choosing the Voted Classifier</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rf08kmuIZS0_ad6tuY9chQ.png" /></figure><p>In the final step here, I’m passing all the classifiers I used through the “VoteClassifier” class I created earlier. This returns the confidence of the final classification as either positive or negative. In the end, I print the accuracy score of the final result presented by the voting system.</p><h3>Output</h3><p>I ran this program many times and got around 70% accuracy on most of my trials. Generally, your accuracy should be between 65%-90%. If it’s near 100%, check if you’ve shuffled your data. If it’s under 60%, your code probably has a bug, so just go through it carefully.</p><p><a href="https://www.youtube.com/playlist?list=PLQVvvaa0QuDf2JswnfiGkliBInZnIC4HL">H<strong>ere</strong>’s</a> the tutorial I followed to build this program.</p><p><em>If you liked this, and want to see more of my content, consider following me on </em><a href="https://medium.com/@suryasure734"><strong>Medium</strong></a> <em>and </em><a href="https://www.linkedin.com/in/surya-sure-9ba9b2220/"><strong>LinkedIn</strong></a><strong>. </strong><em>If you have any questions, feel free to shoot me an email at </em><strong>suryasure734@gmail.com</strong><em>, or send me a message on </em><a href="https://twitter.com/SuryaSure08"><strong>Twitter</strong></a><em>.</em><strong> </strong><em>If you want to follow my journey, you can subscribe to my quarterly </em><a href="https://suryasure.substack.com/?utm_source=%2Fprofile%2F49603877-surya-sure&amp;utm_medium=reader2&amp;utm_campaign=substack_profile&amp;sort=new"><strong>Newsletter</strong></a><strong>.</strong></p><p><strong><em>We’re providing opportunities for the next generation of student thinkers, inventors, and learners, to publish their thoughts, ideas, and innovation through writing.</em></strong></p><p><em>Our writers span from all areas of topics — from </em><a href="https://studentsxstudents.com/"><em>Growth to Tech, all the way to Future and World</em></a><em>.</em></p><p><em>So if you feel like you’re about to jump into a rabbit hole of reading these incredible articles, don’t worry, we feel the same way. ;)</em></p><p><em>That’s why </em><a href="https://studentsxstudents.com/"><em>studentsxstudents</em></a><em> is the place for getting your voice heard!</em></p><p><em>Sounds interesting? </em><a href="https://studentsxstudents.com/for-students-by-students-becoming-a-contributor-and-expanding-your-impact-f6da9189fa78"><em>Why not join us on this epic journey</em></a>?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c15911e48092" width="1" height="1" alt=""><hr><p><a href="https://studentsxstudents.com/sentiment-analysis-of-movie-reviews-using-nlp-c15911e48092">Sentiment Analysis of Movie Reviews Using NLP</a> was originally published in <a href="https://studentsxstudents.com/">students x students</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using NLP to Increase Quality of Education in Developing Countries]]></title>
            <link>https://studentsxstudents.com/using-nlp-to-increase-quality-of-education-in-developing-countries-d1f9a7ef078d?source=rss-3213a50aa3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1f9a7ef078d</guid>
            <category><![CDATA[enjoy-writing]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Surya Sure]]></dc:creator>
            <pubDate>Wed, 19 Oct 2022 02:04:03 GMT</pubDate>
            <atom:updated>2022-10-30T18:00:35.320Z</atom:updated>
            <content:encoded><![CDATA[<p>How would you rate your experience in school out of 10?</p><p>I’d probably give it a solid 8.</p><p>But let me tell you about a sad reality.</p><p>Even if you didn’t necessarily have a great experience, the quality of your education was at least 10X better than what millions of kids experience in developing countries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*3TlQo8baHUNYiooq" /></figure><h3>Low-Quality Education Provides Minimal Value</h3><p>A lot of kids in Africa don’t go to school. There are several reasons for this, but the most common is that they don’t have time to go to school. This is usually due to one of the following reasons: they are suffering from poverty, and have to make a living, they have to take care of family members, or inequalities present in their community are preventing them from going to school. Solving this problem requires you to tackle root causes that are nuanced and complicated in nature.</p><p>But let’s put aside this problem for a second. What about the kids who <strong>DO</strong> go to school? To your surprise (or maybe not), even the kids who receive an education in Africa end up in similar positions to those who don’t.</p><p>In Nigeria, <strong>80% of 3rd-grade students are unable to read a single word. </strong>In comparison, North American students are expected to be able to fluently read and write by that age. This goes to show the quality of education, or lack thereof, in developing countries.</p><p>While lack of accessibility to education is often the more discussed problem, the lack of <strong>quality </strong>education is just as important. Without quality education, children won’t gain any value from their education that could improve the future. Instead, they would end up back in the local workforce, and maybe even in poverty. If this is the case, what’s the point of even getting an education? It’s clear that quality education is important to creating a valuable workforce, decreasing unemployment rates, and helping people get out of poverty. So why is it not a priority in Africa?</p><p>Schools in Africa suffer from the same problem as the citizens: lack of economic resources. Let me ask you a question real quick: what do you think is the most important factor in our education? Resources? They aren’t mandatory, but they definitely help. Community? Not necessarily, but it makes school more enjoyable. <strong>Teachers? You got it</strong>.</p><p>Yes, teachers are the backbone of any education system. Without properly trained teachers, students won’t be able to learn much, and this is exactly what’s happening in Africa. The government doesn’t have enough money to <strong>train teachers</strong> properly, or at least to the bare minimum, which lowers the quality of education for all students.</p><p>Due to the lack of proper training, the teachers don’t know what they’re teaching too well, and they aren’t able to adapt to the needs of every child. Even worse, many of these teachers are teaching as a 2nd job/side hustle, and therefore don’t care about the growth of the children. This has also resulted in <strong>high rates of teacher absence</strong> in schools in Africa.</p><h3>What If We Had an AI Teacher?</h3><p>As I was thinking about this, I came across the idea of an <strong>artificial teacher</strong>, powered by AI, that the students can vocally interact with, and one that provides personalized lessons. It would resemble the student-teacher interaction which would favor the student, as opposed to an e-learning platform, as students will be able to ask questions, get feedback, and get help identifying their weaknesses. An e-learning platform, on the other hand, does not offer these advantageous capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*BrPCF3HOQw0RByQD.jpeg" /></figure><p>We are nowhere close to being capable of providing every child in Africa with this right now, and we probably won’t be for at least the next 10 years. But that doesn’t mean we should completely dismiss the idea. There are already several personalized learning platforms available today, so the personalized learning aspect is not difficult. The real challenge is in creating the artificial teacher. Ideally, the teacher would be able to answer all questions the students have and support them as a real teacher would. To build this right now, we would need an immense amount of data, as well as algorithms to make the teacher more comprehensive of student psychology.</p><p>The first step in educating these kids is to <strong>teach them English. </strong>Teaching English first accomplishes a few things:</p><ul><li>It allows students to learn terminology in English, exposing them to the global standard,</li><li>It provides students with the ability to connect with overseas markets.</li><li>It would eliminate the need for the teacher to teach and provide resources in multiple languages, which would make development easier.</li></ul><p>Currently, however, the closest thing we have to an artificial teacher is a voice assistant, which as you probably know, is quite far away from being able to teach English. So how do we get to that stage from where we are now?</p><h3>The Tech Behind the Scenes</h3><p>The technology used for speech recognition and generation is a branch of Artificial Intelligence (AI) called <strong>Natural Language Processing (NLP)</strong>. NLP focuses on the interaction between data science and human language and attempts to understand the meaning behind sentences. There are 2 sections within NLP: <strong>Natural Language Understanding (NLU)</strong> and <strong>Natural Language Generation (NLG)</strong>. NLG is a computer’s ability to generate its own communication and NLU is the ability to grasp slang, mispronunciations, misspellings, and other linguistic variations.</p><p>You’ve probably been using NLP for years without knowing what it actually is. In fact, you probably found this article by using an NLP-powered platform: Google. <strong>Google</strong> uses NLP to interpret search requests and show results that include words that match the query. Although this is a fairly simple use of NLP, it’s still crucial to our everyday lives. A more advanced example of NLP in an application is <strong>Grammarly</strong>, which analyzes text for meaning and context, to correct spelling and grammar mistakes. The point I&#39;m trying to get across is that NLP is crucial to our everyday lives and will completely change how we communicate with computers in the future.</p><h3>Current State of NLP in Education</h3><p>NLP-based applications are gaining more traction in institutions throughout North America. Here are a few use cases of NLP:</p><ul><li><strong>Feedback on Writing: </strong>NLP is being used to analyze student writing pieces to identify grammar and mechanics errors and give feedback. Since teachers can’t give detailed feedback to every student on their essays, applications that do this are helpful for both the teacher and the students.</li><li><strong>Reading Assessment: </strong>NLP is being used to grade student reading, based on their accuracy, pace, clarity, and confidence. This has been more accurate than traditional reading assessment methods.</li><li><strong>Answer Machines:</strong> These are essentially chatbots that answer a student&#39;s question. Some variants of these have tone and emotion embedded into them, to appeal to the children more.</li><li><strong>Translation: </strong>Translation platforms help students who are learning English as a second language. They help them learn English faster and practice it outside of school. They’re also generally helpful to learn any language.</li><li><strong>Engagement Analysis: </strong>NLP programs are assessing the words and tone used by teachers and comparing it with the engagement of the students, to see how teachers can become more engaging.</li></ul><h3>A Few Obstacles Are In the Way</h3><p>The first step to taking NLP applications to the next level is improving NLU to understand different accents and dialects used by English speakers. So why isn’t this being done now?</p><p>First of all, for an artificial tutor to be able to teach English, it would have to understand and be able to fluently speak other languages. Currently, most home assistants are only available in English, since Google and Amazon’s primary market is North America. To develop a tutor, we would have to train the assistants with datasets of other languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/0*HYGjAUJUA4zBMPCa.jpg" /></figure><p>Even within English, voice assistants lack the ability to fully understand different speaking habits, due to the lack of diverse training data, containing different <strong>accents, dialects, and slang</strong>. As a result, voice assistants are up to <a href="https://www.washingtonpost.com/graphics/2018/business/alexa-does-not-understand-your-accent/"><strong>30% less accurate</strong></a> when communicating with non-native speakers, compared to native speakers. Even for native speakers, there is a disparity between the ease of communication for people from different regions (take the East Coast vs Southern, for example).</p><p>This problem has to be addressed if we were to build an artificial tutor to teach English, as even in other languages, people will have <strong>differing speaking habits</strong>; children in developing areas will have different speaking habits compared to people who live in cities. If the tutor was only able to understand proper and by-the-book versions of a language, it wouldn’t prove much use to the children.</p><p>Quick fixes, such as introducing gathered queries into the training model or adding specific vocabulary words into the dictionary, are only going to be a bandaid, patching a single facet instead of the larger pattern.</p><p>Another obstacle is that students in developing countries currently don’t have widespread access to technology, but within 20 years, this likely won’t be a problem, given the exponential growth of access to technology in recent years. Currently, 473 million Africans are online, and by <a href="https://www.whitecase.com/insight-our-thinking/africas-digital-infrastructure-transformation#:~:text=Africa&#39;s%20demand%20for%20internet%20access,many%20opportunities%20for%20the%20continent.">2025, 300 million more are expected to join them</a>, nearly doubling the percentage within less than half the time it took to originally get to 300 million. This margin of growth will only increase every year, making this obstacle one that can be overcome with time.</p><h3>We Need More Data</h3><p>The next step for leading companies in voice assistant technology such as Google and Amazon is to obtain and train their products with more datasets of diverse speakers. Once the assistants are able to understand non-native English speakers, they can focus on communicating with them in a similar manner. Although this is a time and money-consuming process, they will have to obtain more diverse data one way or another to grow their products to more markets.</p><h3>Major Players In This Space</h3><p>Here are a few companies working on a conversational tutor:</p><ul><li><a href="https://quantiphi.com/industries/education/#overview"><strong>Quantiphi</strong></a>: Offers many different educational resources powered by AI, including a personalized tutor.</li><li><a href="https://www.korbit.ai/"><strong>Korbit</strong></a>: Offers a personalized learning platform, with exercises that are powered and assessed by AI chatbots, similar to an instructor.</li><li><a href="https://elsaspeak.com/en/"><strong>ELSA</strong></a>: Offers an app that helps non-native speakers learn English and improve their pronunciation. Their AI tech was trained with data from non-native speakers, which makes learning easier, as learners can choose which accent they want the AI instructor to have.</li><li>Education in Africa provides close to no value due to the miserable quality of the teachers. The governments don’t have enough resources to train teachers properly, which results in lackluster teaching and even high rates of teacher absences.</li><li>An artificial tutor, powered by AI would solve this problem. Ideally, it would be able to have a conversation with a student, using NLP, and provide personalized learning. This would remove the need for teachers.</li><li>NLP is a branch of Artificial Intelligence that focuses on the interaction between data science and human language and attempts to understand the meaning behind sentences. Within NLP, there are 2 subcategories: <strong>Natural Language Understanding (NLU)</strong> and <strong>Natural Language Generation (NLG)</strong>. NLG is a computer’s ability to generate its own communication and NLU is the ability to grasp slang, mispronunciations, misspellings, and other linguistic variations.</li><li>Currently, NLP is being used to assess writing and reading, answer student questions, help with translation, and assess the engagement level of teachers.</li><li>The first thing this tutor would have to be able to do is teach English. Currently, the closest things we have to an English tutor are voice assistants, which are still lackluster. Their primary obstacle is that they have a harder time understanding non-native English speakers. This is due to a lack of diverse training datasets. To take their products further, Google and Amazon have to acquire datasets of diverse speakers and train their products with that data.</li></ul><h3>Wrapping It Up</h3><p>Education is a difficult problem to solve due to the many root causes and the complexity of each one of them. However, we can at least help the kids who DO go to school get the most out of their education.</p><p><em>If you liked this, and want to see more of my content, consider following me on </em><a href="https://medium.com/@suryasure734"><strong>Medium</strong></a> <em>and </em><a href="https://www.linkedin.com/in/surya-sure-9ba9b2220/"><strong>LinkedIn</strong></a><strong>. </strong><em>If you want to see my growth, you can subscribe to my quarterly </em><a href="https://suryasure.substack.com/?utm_source=%2Fprofile%2F49603877-surya-sure&amp;utm_medium=reader2&amp;utm_campaign=substack_profile&amp;sort=new"><strong>Newsletter</strong></a><strong>.</strong></p><p><strong><em>We’re providing opportunities for the next generation of student thinkers, inventors, and learners, to publish their thoughts, ideas, and innovation through writing.</em></strong></p><p><em>Our writers span from all areas of topics — from </em><a href="https://studentsxstudents.com/"><em>Growth to Tech, all the way to Future and World</em></a><em>.</em></p><p><em>So if you feel like you’re about to jump into a rabbit hole of reading these incredible articles, don’t worry, we feel the same way. ;)</em></p><p><em>That’s why </em><a href="https://studentsxstudents.com/"><em>studentsxstudents</em></a><em> is the place for getting your voice heard!</em></p><p><em>Sounds interesting? </em><a href="https://studentsxstudents.com/for-students-by-students-becoming-a-contributor-and-expanding-your-impact-f6da9189fa78"><em>Why not join us on this epic journey</em></a>?</p><p><a href="https://studentsxstudents.com/">students x students</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1f9a7ef078d" width="1" height="1" alt=""><hr><p><a href="https://studentsxstudents.com/using-nlp-to-increase-quality-of-education-in-developing-countries-d1f9a7ef078d">Using NLP to Increase Quality of Education in Developing Countries</a> was originally published in <a href="https://studentsxstudents.com/">students x students</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Checking the Time and Date With My Brain]]></title>
            <link>https://medium.com/@suryasure734/checking-the-time-and-date-with-my-brain-956ee1e11d84?source=rss-3213a50aa3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/956ee1e11d84</guid>
            <category><![CDATA[brain-computer-interface]]></category>
            <dc:creator><![CDATA[Surya Sure]]></dc:creator>
            <pubDate>Tue, 28 Jun 2022 20:22:38 GMT</pubDate>
            <atom:updated>2022-06-28T20:22:38.715Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Note: You will need a basic level of Python knowledge to understand this article.</em></p><p>When was the last time you checked the time? Probably at least once today right? We’re so accustomed to having access to certain information instantly, that we forget people suffering from disabilities don’t have this luxury. They can still receive the information, but it’s a longer process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*pCl8-ouo15ojjo2Y" /></figure><p>I don’t know about you, but I certainly wouldn’t want to wait a whole minute or even longer to know the time, because it’s something that I check at least once an hour. So what if we could check the time with our brain?</p><p><em>Guess what? We actually can.</em>🤯</p><p>I created a program that allows you to check the time and date, based on your mental state, with the help of a BCI (brain-computer interface). A BCI connects to your computer and measures your brain signals when it’s worn around your head. It sends those signals to your computer and shows your live brain activity.</p><p>You can think of it as a Fitbit for your brain. But what does it actually track?</p><p>Neural oscillations.</p><h3>The Neuroscience Behind the Scenes</h3><p>Your brain is always active. It’s constantly producing waves of different frequencies. The neurons in your brain communicate by sending electrical impulses to other neurons, which generates electrical activity. When similar electrical signals are sent synchronously between groups of neurons, rather than singular neurons, it creates a wave-like pattern. These waves are called <strong>neural oscillations</strong>.</p><p>These oscillations reflect your mental state. They differ based on the current task you’re doing at that time. There are 5 types of oscillations, each within a certain range of frequencies. These are delta, theta, alpha, beta, and gamma:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*yPLC5cti5IQUJf4R.png" /></figure><ul><li><strong>Gamma</strong> (32–100 Hz): Emitted during a life or death situation.</li><li><strong>Beta</strong> (13–32 Hz): Emitted when concentrating and problem-solving.</li><li><strong>Alpha </strong>(8–13 Hz): Emitted while relaxing or closing eyes.</li><li><strong>Theta </strong>(4–8 Hz): Emitted during sleep, daydreaming, and meditation.</li><li><strong>Delta </strong>(0.5–4 Hz): Emitted during deep sleep and meditation.</li></ul><p>I specifically used the alpha and beta waves for this project. Essentially, I wrote a program that tells the time if alpha waves are being emitted and tell the date if beta waves are being emitted. So if you close your eyes, you’ll know the time and if you don’t, you’ll know the date.</p><h3>Equipment and Tools</h3><h4>Data Collection</h4><p>I used my own brain data for this project. I could’ve used datasets collected from other people, but they’re much harder to work with, so I ended up using my own data. To collect the data, I used the <a href="https://shop.openbci.com/products/ganglion-board">OpenBCI Ganglion Board</a>, which is a BCI with 4 channels. A channel consists of the data collected from <strong>one electrode</strong>, and I have 4 electrodes in my headset.</p><p>I placed the electrodes near the front of my head; 2 on my forehead and 2 on the opposite sides of my head; because most of my basic neural activity is much easier to detect at the front.</p><p>I then connected the board to my computer via Bluetooth and streamed my live data on a GUI that OpenBCI provided. I was able to visualize my data here and mess around with the filters to see how much filtering I need to eliminate the noise (artifacts such as blinking, heartbeats, or movement).</p><h4>Data Processing</h4><p>To process the data and write my program, I used Python. Specifically, a library within Python called BrainFlow. BrainFlow has specific functions and commands designed for developer BCIs, making it super easy to connect my board and start the data stream in Visual Studio Code. There’s also sample code in the BrainFlow documentation, so I don’t have to memorize the commands, making it very easy to work.</p><h3>Code Breakdown</h3><p>Now let’s get to the fun part. I’ll explain each part of the code to help you understand the logic behind it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*BxLGqLgSq-L-ayntKa5xMw.png" /></figure><p>This is the first part of the code, where we import all of the libraries and functions we need. The first two imports are for the input back to the user; <em>datetime</em> is to import the current time and date into python when the user asks for it and <em>pyttsx3 </em>is to turn it into speech. The rest of them are for connecting with the board and processing the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*hzJUYDYP8B5cIgapck1psg.png" /></figure><p>In this part, I’m letting the computer identify my board. The def main(): is saying all of the following code is part of a function called main, which we can then run later. In BrainFlow, each headset has different values associated with it. These values are the params.board_id and board_id. The params.serial_port is indicating which USB port I plugged by board dongle into. I have to assign the values of my board to these variables to connect my board to the computer. The following variables are getting the properties of my board. Then at the end, the computer starts receving the data from my brain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*HVqMgMd63wmPCGyasEpL8w.png" /></figure><p>Here, the computer takes 10 seconds to look at my data and stores all of it. It then stops the stream to process and use the data it received in those 10 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*CyzF1j0FI8LIvF44Qlm6VA.png" /></figure><p>This is just for further filtering. Essentially, the computer&#39;s taking data from one of my channels and detrending it. A detrend is when a trend is removed from the data. For example. if the EEG values are increasing and they diverge from the rest of the values, it removes that trend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*i8I93u39NA-PnAjNLGfjJA.png" /></figure><p>This part is the data filtration. It may seem complicated but I’m just applying the same filters 4 times, for each channel. The two types of filters applied here are <strong>bandpass</strong> and <strong>bandstop</strong>.</p><p>The bandpass filter only accepts values within a certain threshold. For example, if the threshold is 7–15hz, it only accepts values between 7 and 15. A bandstop filter does the exact opposite — it only accepts values outside of a certain threshold. So in this example, a bandpass filter would only accept values under 7 and above 15.</p><p>In this case, you can see that both filters have certain values in their code. These values are the parameters for the filters. The first values (60 and 21) are the center frequency of the waves (the middle value). The second values (4 and 20) are the difference between the highest and lowest frequencies.</p><p>Since we know the center frequencies, we can calculate the highest and lowest frequencies by either adding or subtracting the differences. Finally, the last 2 are constants that are necessary for these filters to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*q0TGvXtbPUkI_jp6DEVxAQ.png" /></figure><p>Here, I’m getting the power of the alpha and beta waves from the data and assigning them to variables, so they can be used later. In the brackets, I’m providing the range of the frequencies of alpha and beta waves. Then, I’m printing the alpha divided by the beta because I need to make sure it isn’t above 1. If it is, the program is malfunctioning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*_ZXMmvjH-fQh6TncZ7dTvw.png" /></figure><p>In this part, I’m printing the values of the alpha and beta bands and importing the current date and time. The datetime function allows me to import date and time, so I’m assigning each of them to separate variables. The last line is to set up the text-to-speech function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/1*_kap1nwiLAxZqTwU6Wplng.png" /></figure><p>This part is pretty self-explanatory. If the alpha and beta waves are below certain values, either provide the time or date. If the result of their division is less than 1, say it’s an error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/1*JZI6_s2XaJRkh9ygTtBwZQ.png" /></figure><p>Finally, I’m calling the function, which means I’m running all of the above code.</p><h3>Demo</h3><p>Here’s a YouTube video I made, giving a quick overview of the project and another code breakdown. I also added a quick demo of the project at the end, so if you want to see it, skip to 9:16.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FYqToVD_CylY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYqToVD_CylY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FYqToVD_CylY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/32a23f248f8ad983f70e8901e63b15eb/href">https://medium.com/media/32a23f248f8ad983f70e8901e63b15eb/href</a></iframe><p>Hopefully, you enjoyed this explanation of my project. I have future plans to build a program that allows me to send a tweet with my brain, and it would function similarly to this. Stay tuned for it!</p><p><em>If you enjoyed this and want to see more of my content, consider following me on </em><strong>Medium and </strong><a href="https://www.youtube.com/channel/UCeXFouw5_U15ZZjqxGaLB_w"><strong>YouTube</strong></a><strong>. </strong><em>If you have any questions feel free to reach out to me via </em><a href="https://www.linkedin.com/in/surya-sure-9ba9b2220/"><strong>LinkedIn</strong></a><strong> or email </strong><em>me at</em> suryasure734@gmail.com.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=956ee1e11d84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Carbon Sense]]></title>
            <link>https://medium.com/@suryasure734/carbon-sense-d4bd3423fc0b?source=rss-3213a50aa3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4bd3423fc0b</guid>
            <category><![CDATA[carbon]]></category>
            <dc:creator><![CDATA[Surya Sure]]></dc:creator>
            <pubDate>Fri, 06 May 2022 00:48:58 GMT</pubDate>
            <atom:updated>2022-05-06T00:48:58.799Z</atom:updated>
            <content:encoded><![CDATA[<p>You’re in the year 2100.</p><p>What are you expecting to see?</p><p>Robots, flying cars, and teleportation? Sure, you might see those.</p><p>But you’ll also see 680 million people who lost their homes due to rising sea levels. You’ll see an average temperature that is 4 degrees Celsius higher than today. And you&#39;ll see a skyrocketing number of natural disasters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*JePnurnLYzjMIFiq" /></figure><p>What’s the largest contributor to all of this? Carbon dioxide.</p><h3>Where Does the Problem Lie?</h3><p>Let’s take a look at how CO2 increases the global temperature.</p><p>Think of it like this.</p><p>You’re in a room built with glass, all around. The room has visible light shining through the glass. This light generates heat and increases the temperature of the room.</p><p>You can’t decrease the temperature and the light’s still shining. Even worse, only 10% of the heat generated from the light is reflected back to where it came from, meaning 90% of the energy released from the light remains in the room.</p><p>Also, you realize that the glass is slowly increasing in thickness, trapping more heat. So unless you reduce the thickness of the glass, you have no chance of surviving in the future.</p><p>This is exactly what is happening to the Earth right now, and it’s called the <strong>greenhouse effect</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*Paad2ltSDz7eKY3q" /></figure><p>Sunlight that passes through the Earth’s atmosphere hits the ground and loses some energy, turning it into infrared light.</p><p>The initial infrared light is necessary to keep our planet warm, but when the infrared light is trying to go back to space, certain gases in our environment trap infrared light and redirect it back at the Earth, causing further warming.</p><p>These are known as <strong>greenhouse gases</strong>. These gases trap <strong>90% </strong>of the infrared light trying to escape and redirect it back at the Earth.</p><p>Carbon dioxide accounts for <strong>80% of all greenhouse gas emissions in the US</strong>.</p><p>And it’s going to increase. In fact, CO2 emissions have increased <strong>sixfold in the past 70 years.</strong></p><p>Despite the significant technological growth in the last 20 years, there&#39;s been close to no change in the way we produce energy.</p><p>Why? Because fossil fuels are cheap. Their abundance makes them easier to sell in bulk, which reduces the buying price. We also have entire energy infrastructures based on fossil fuels, so it would cost a ton of money to change sources.</p><p>A large contributor to carbon emissions in the US is the industrial sector.</p><p>The industrial sector is responsible for approximately 25% of carbon emissions in the US. This adds up to <strong>1.25 billion tonnes </strong>of CO2 emitted annually.</p><p>To put this into perspective, that’s equivalent to the weight of 3,775 empire state buildings. Let that sink in.</p><p>Even worse, since 1970, CO2 emissions have increased by about <strong>90%</strong>, with emissions from fossil fuel combustion and industrial processes contributing about <a href="https://www.epa.gov/ghgemissions/global-greenhouse-gas-emissions-data#:~:text=Global%20carbon%20emissions%20from%20fossil,increase%20from%201970%20to%202011."><strong>78% of the total greenhouse gas emissions</strong></a> increase from 1970 to 2011.</p><p>If we keep this up, the global temperature could increase by up to 5.4 degrees Celsius by 2100, which would drastically change the environmental conditions of the earth for our future generations, making it harder for them to survive.</p><p>More frequent and intense drought, storms, heatwaves, rising sea levels, melting glaciers, and warming oceans can directly harm animals, destroy the places they live, and wreak havoc on people’s livelihoods and communities.</p><h4>Process Heating — The Problem Child</h4><p>There are different uses for heat in a factory, but by far the largest use case is process heating, which is a procedure used to generate electricity in industrial buildings.</p><p>Process heating is how manufacturing equipment is powered. Essentially, it’s the backbone of most manufacturing plants.</p><p>These are the steps involved in process heating:</p><ol><li>Fossil fuels are burned and undergo combustion to produce heat. The combustion reaction releases carbon dioxide. IT also releases energy, however, since combustion breaks the chemical bonds between the hydrogens and carbons that make up a fossil fuel, which releases the energy stores between the bonds. This is the chemical equation behind the combustion of fossil fuels:<strong> CH4 + 2O2 → CO2 + 2H2O + Energy.</strong></li><li>This heat is used to boil a large tank of water to evaporate the water and create steam</li><li>The steam travels through a pipe to a steam turbine, which then generates electricity by turning.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/0*TGr_gu0g93SXjt7-.jpg" /></figure><p>This system is dependent on heat since the turbine is powered by steam and fossil fuels are currently the easiest way to generate such large amounts of heat. This system is also highly inefficient, hovering at around 30% efficiency. Most of the energy generated from burning the fuels is lost throughout the process, and only 30% ends up being used at the end.</p><p>It’s clear that the current system of generating electricity is quite flawed.</p><h3>Current Methods Just Aren’t Cutting It</h3><p>Obviously, for such a large problem, heavy research and development are being done to tackle factory emissions. One of the leading technologies being used right now is carbon capture. The different types of carbon capture include:</p><ul><li>Post-Combustion — involves removing the CO2 from the flue gas emitted by factories and power plants.</li><li>Pre-Combustion — separating the carbon from the hydrogen and storing it.</li><li>Oxy-Fuel — capturing carbon by burning fossil fuels in an environment with pure oxygen.</li></ul><p>Although carbon capture is effective, the main problem right now is that it’s too expensive to be used on a large scale. It also doesn’t solve the inefficiency of the process heating system, as it doesn’t change anything internally, it just captures carbon externally, so we would still be burning more fuel than we need to.</p><p>Another type of technology, outside of carbon capture, that’s currently being used is renewable energy.</p><p>There are several types of renewable sources used, such as:</p><ul><li>Solar power —gathered from sunlight</li><li>Wind Power — gathered from the strength of the wind</li><li>Geothermal Power — gathered from underground heat</li><li>Hydroelectricity —generated through harnessing the movement of water</li><li>Biofuels — made with agricultural waste</li></ul><p>However, all of these have the same overarching problems — unreliability and upfront cost.</p><p>The main issue with renewables is that they are not always available. They are dependent on environmental factors, which makes them unreliable for factories and power plants. Adding on to that, they also require large investments, as manufacturers would need to change the entire energy infrastructure of the building, and the equipment to collect energy from renewable sources can get quite expensive.</p><p>Because of the numerous flaws in current methods to produce electricity, our team decided to invent a new way to generate electricity for factories, that’s cheap and reliable.</p><h3>Enter <em>Shewanella Oneidensis</em></h3><p>During our research, we came across a technology called Microbial Fuel Cells (MFC). MFCs can convert chemical energy to electrical energy using oxidation-reduction reactions. MFCs contain bacteria that break down organic material, which releases electrons. These electrons are then collected and sent through a wire to generate electricity.</p><p>The MFC will be a plastic box with 2 separate chambers. One chamber is aerobic and has a negatively-charged cathode and the other is anaerobic and has a positively-charged anode. In the middle of the box, there’s a biofilm called Proton-Exchange-Membrane(PEM), separating the two chambers. The PEM is made of polymers and allows H+ protons to pass through the film to the other chamber, while blocking larger molecules such as oxygen, making it an effective separator.</p><p>Currently, MFCs are commonly used for wastewater treatment, as they can convert organic material in the water into electricity.</p><p>For our product, we decided to use a bacteria called Shewanella Oneidensis, which is known for its ability to reduce metal ions and live in anaerobic environments.</p><p>We developed our product around Shewanella Oneidensis and its efficiency in converting compost into electricity.</p><h4>Generating Electricity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*8HFk3CojspiBV28I.png" /></figure><ol><li>The compost will be dumped into the anaerobic chamber, which is where the anode resides. The bacteria will be sticking to the anode, like a film. To keep oxygen out of the chamber, we pump nitrogen to displace it, whenever we put in more compost.</li><li>When the Shewanella comes into contact with the compost, it starts oxidizing the organic material, releasing electrons, H+ protons, and CO2. The CO2 emitted will be the same amount of CO2 that the plants in the compost consumed when they were alive, making the fuel <strong>carbon neutral.</strong></li><li>35% of the electrons go into the external circuit, while the others are floating around in the chamber. The circuit is connected to different factory equipment and it converts 95–98% of the electrons’ energy into alternating current(AC). DC is what is used to power all factory machines. The rest of the energy from the electrons is lost as heat energy. The H+ protons go across the PEM membrane, into the aerobic chamber, due to repulsion from the concentrated group of electrons near the anode. After going through the external circuit, the electrons will go to the cathode.</li><li>Once they exit the circuit, the electrons then travel to the cathode and engage in a reduction reaction (reunite) with the H+ protons to become H atoms, in the aerobic chamber. They react with the oxygen in the chamber and form water, in the form of this equation:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*bwBhSQJXaQjea-2mY7aZYA.png" /></figure><p>Once the Shewanella oxidizes the compost, all that’s leftover is dirt, which we can use as soil by collecting it from the chamber. In the aerobic chamber, the H atoms will react with oxygen to form water, which we can empty once it becomes full.</p><p>Once we fully deploy our product, throughout the US, we could potentially increase the efficiency of the cells by injecting silver nanoparticles, as explored in <a href="https://www.sciencedaily.com/releases/2021/09/210916142846.htm#:~:text=Shewanella%20species%20naturally%20break%20down,fuel%20cell%20that%20produces%20electricity">this article</a>. This would boost the efficiency of the system, allowing it to produce more electricity, with less compost. If there ever is a shortage of compost, or conditions where compost can’t be delivered to factories, they could use silver nanoparticles to get enough electricity from a limited supply of compost.</p><h4>Material Choices</h4><p>The power output of MFCs depends on several factors such as type of substrate, exoelectrogenic microorganisms, circuit resistance, electrode material, reactor configuration, and electron acceptors. Each of our material choices increases the efficiency and economic viability of our product.</p><p>We chose Shewanella for our bacteria because it’s an <strong>exoelectrogen</strong>. Exoelectrogens attach themselves to the anode, which makes the electron transfer more efficient, as more electrons will go through the anode.</p><p>For the anode and cathode material, the obvious choice was graphite, due to its balance of low cost, abundance, high power density, and long lifespan. Most anodes currently use graphite due to these advantages and we don’t plan on changing that.</p><p>For the electron acceptor in the aerobic chamber, where the cathode is, we had quite a few options but decided to go with oxygen in the end. Different acceptors have different chemical and physical properties, so they would change the efficiency of electricity production. We decided to use oxygen because it’s quite efficient and the product after reduction (reuniting with electrons) is just water, which is easy to dispose of.</p><p>For the actual cell itself, we’re using plastic because it doesn’t interfere or react with the bacteria and electrons. If we use certain metals, the electrons would completely change positions, making them unable to be used for electricity. Also, plastic is much more chapter than any metal, so it’s the obvious choice.</p><h3>Implementation</h3><p>The compost we use will be from the government. The government will collect compost from household to household, as part of waste management, and we will buy the compost from them. The fees we pay to the government will be paid through a licensing fee that the manufacturers have to pay when they buy our product. It will be a monthly fee that includes the cost of the compost and any servicing to keep the product in good condition.</p><p>The leftover dirt in the anaerobic chamber will be collected by us, which we will then sell since it’s fertile and can be used as soil. The water in the aerobic chamber will be released and drained when the tank becomes full.</p><p>The cells will be arranged in quadrants, where 1 quadrant has 100 cells. We will have 10 quadrants in total. Each quadrant will have its own circuit and each cell will be linked to the quadrant’s circuit. Although the quadrants are separate, they can still be combined, as they are connected to each other in series.</p><h3>Cost Breakdown</h3><p>Not only does our product have to function, but it has to be economically viable. We made sure that it doesn’t become too expensive.</p><p>The total fuel cell cost is approximately <strong>$63,000</strong>. Here’s the breakdown:</p><p>The required materials for one cell are plastic, PEM, graphite sheets, wire, 3 small pumps, and 1 large pump.</p><p>The following calculations are for one quadrant which is a group of 100 boxes.</p><ul><li>Plastic — $26.86</li><li>PEM — $2000</li><li>Graphite Sheets — $51.2</li><li>Wire — $130</li><li>1 Large Pump — $900</li><li>3 Small Pumps — $1332</li><li>Total per quadrant = $6295.20</li><li>Total cost for an average factory = $62950.20</li></ul><p>Since we are using the compost the government will collect, we will need to pay them a fee. The factories will pay this fee, of approximately $1000 a month. This will cover the fee that we pay to the government and the fee for us to collect the leftover compost after the oxidation reaction.</p><h3>Why would manufacturers use our product?</h3><p>Manufacturers would prefer our product over current alternatives for one simple reason.</p><p>Our product is affordable and economically viable.</p><p>If our product is relatively close to the price of fossil fuels, manufacturers have no reason not to use our product. It significantly reduces carbon emissions in the US, while being affordable. On top of that, the government will provide incentives for manufacturers that go green, similar to what they are currently doing with electric car owners.</p><p>Our product also addresses the main problems with renewable energy and carbon capture.</p><p>It’s always available and affordable, making it a much more reliable source of energy than the other two.</p><p>It could also potentially be used in tandem with carbon capture technology to remove the carbon it emits, making it a <strong>carbon-negative fuel</strong>, since the plants in the compost absorbed carbon while they were alive.</p><h4>Expansion Plan</h4><p>Our goal doesn’t stop with the US. After implementing our product in all industrial buildings throughout the US, we are planning to expand to more countries. By 2030, our goal is to implement our product in all factories in the US. Our next target after that is China since it has the most carbon emissions in the world. The only reason we aren’t implementing it in China first is that the compost collection system is different from the US and data is harder to acquire. We plan to have our product implemented in all factories in China by 2050. After that, we’ll tackle India, followed by other European nations.</p><h3>Impact</h3><p>Our product allows us to make significant progress towards our vision of <strong>making Earth sustainable.</strong></p><p>It eliminates carbon emissions produced by factories, resulting in 1.25 billion tonnes of carbon being removed from the atmosphere every year.</p><p>Assuming most factories in the United States are using our product by 2030, this will amount to <strong>20 billion potential tonnes</strong> of carbon that are removed from the atmosphere.</p><p>When our product is fully implemented throughout the US, there won’t be any smoke coming from a factory.</p><p>When you’re driving through an industrial area, it won’t smell horrible. When you’re watching the news about carbon emissions, there won’t be any footage or images of smoke coming out of industrial buildings. None of this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*v-kPMRU90kKrqByl.jpeg" /></figure><p>When you’re having a conversation about carbon emissions, factories will not be mentioned.</p><p>Not. Once.</p><p><em>This article was written in collaboration with Vaibhav Panchanam, Luca Andriescu, Alexandre Boutoille, and Jeffrey Luo — the cofounders of Carbon Sense.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4bd3423fc0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Neurofeedback Program to Assess Concentration and Relaxation]]></title>
            <link>https://medium.com/@suryasure734/building-a-neurofeedback-program-to-assess-concentration-and-relaxation-25f38afc0fdd?source=rss-3213a50aa3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/25f38afc0fdd</guid>
            <category><![CDATA[brain]]></category>
            <category><![CDATA[concentration]]></category>
            <category><![CDATA[neurofeedback]]></category>
            <category><![CDATA[relaxation]]></category>
            <category><![CDATA[bci]]></category>
            <dc:creator><![CDATA[Surya Sure]]></dc:creator>
            <pubDate>Sun, 30 Jan 2022 22:31:20 GMT</pubDate>
            <atom:updated>2022-01-31T21:42:45.292Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m sure you’ve struggled with concentration before. Sometimes, it’s hard to get into “the zone”. One of the reasons people struggle to concentrate is that they are agitated and not in a good mood. Being in this state doesn’t allow you to fully concentrate on what you are doing because you’ll constantly be thinking about what made you frustrated. So in order to have optimal performance, you need to be concentrated <strong>and </strong>relaxed. However, when you try to relax or meditate, you have a bunch of thoughts going around in your head and you end up not being able to relax. That’s why I built a program that lets you see how well you are either concentrating or relaxing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/0*ugnubGCUXU3PkU7N.jpg" /></figure><h3>Neurofeedback…?</h3><p>Yes, neurofeedback.<strong> Neurofeedback</strong> is a type of biofeedback that measures brain waves and sends signals to a computer. It essentially gives you feedback on what your brain is doing. To measure your brain signals and get neurofeedback, we use a <strong>brain-computer interface (BCI)</strong>, which is a device that measures your brain activity and sends it to a computer. The computer is then programmed to perform a certain task based on those signals.</p><h3>A Little Bit of Neuroscience</h3><p>To assess my concentration and relaxation, I measured my neural oscillations. Neural oscillations (aka bands) are waves that your brain produces based on your mental state. There are 5 different bands:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*oyWiYvPktH7ckZPr.png" /></figure><ul><li><strong>Gamma</strong> (32–100 Hz): Emitted during a life or death situation.</li><li><strong>Beta</strong> (13–32 Hz): Emitted when concentrating and problem-solving.</li><li><strong>Alpha </strong>(8–13 Hz): Emitted while relaxing or closing eyes.</li><li><strong>Theta </strong>(4–8 Hz): Emitted during sleep, daydreaming, and meditation.</li><li><strong>Delta </strong>(0.5–4 Hz): Emitted during deep sleep and meditation.</li></ul><p>For this project, I combined the Delta and Alpha bands and used a machine-learning algorithm to predict how high my concentration and relaxation values are.</p><h3>Data Extraction</h3><p>For this project, I used the <a href="https://shop.openbci.com/collections/frontpage/products/ganglion-board?variant=13461804483"><strong>OpenBCI Ganglion Board</strong></a> to track my brain signals. The Ganglion Board has <strong>4 channels</strong>, meaning I can connect 4 electrodes to my head. I connected the board to my computer via Bluetooth and was able to monitor the power of each band in the OpenBCI GUI, which is an application, where I can see multiple different types of brain data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xiFLvZIz-PktwTdz" /></figure><h3>The Programming</h3><p>Obviously, I need to program the computer for this project to work. I did a lot of programming for this project, so if you want to see it, you can go to my <a href="https://github.com/SurjaHead/Neurofeedback/blob/main/main.py"><strong>GitHub</strong></a>. I’m gonna go over most of the code and explain what each section does.</p><h4>Setting Up Parameters</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*UZDkfnDvlo4FKGNIUKsuJg.png" /></figure><p>This is the first part of the code, where I’m importing all of the <strong>libraries</strong> and <strong>functions</strong> that I will need later on. Pandas, matplotlib, and NumPy are to plot the data and the rest are for the actual analysis of my EEG data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*SQURipXPKJbl0dFu4zTRYA.png" /></figure><p>Here, I’m entering parameters to help my computer identify my board. Every headset has different parameters in BrainFlow and I have to input the parameters for the Ganglion board to connect it to my computer. In the next part, I’m connecting the board to my computer and getting data from my board.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*jUAFJ2UxIPgNxgl4sg5FDg.png" /></figure><p>First, I’m setting up the axes for my graph. Then I’m setting up empty lists at the end to store the EEG data, which I can add to later, so that I can see the values in my data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*hrDPRRtnnL9K1biytY4Ohg.png" /></figure><p>This part is pretty simple; I’m starting the data stream to get my EEG data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*YXdl14tz4ovZqvtCyCEsew.png" /></figure><p>In this step, I’m setting up the data frame that shows the values from the EEG data in each channel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*L4Bjp0cUMjlVWDQNkrlMdQ.png" /></figure><p>This part may seem complicated but all I’m doing is just applying the same filters 4 times, for each channel. The two types of filters applied here are <strong>bandpass</strong> and <strong>bandstop</strong>. The bandpass filter only accepts values within a certain threshold. For example, if the threshold is 7–15hz, it only accepts values between 7 and 15. A bandstop filter does the exact opposite — it only accepts values outside of a certain threshold. So in this example, a bandpass filter would only accept values under 7 and above 15. In this case, you can see that both filters have certain values in their code. These values are the parameters for the filters. The first values (60 and 21) are the center frequency of the waves (the middle point). The second values (4 and 20) are the difference between the highest and lowest frequencies. Since we know the center frequencies, we can calculate the highest and lowest frequencies with the differences. Finally, the last 2 are constants that are necessary for these filters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*By790JtrMGwelY_KhUH_0A.png" /></figure><p>This is where I apply some machine learning algorithms. These algorithms are already trained on the BrainFlow documentation and they show the relaxation and concentration thresholds, based on the delta and theta bands. The algorithm used here is <strong>KNN</strong>, which essentially takes my data and separates it into groups based on similarities that my data points share with each other. This is how the computer predicts how my concentration/relaxation is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*QV_OIPPnsQTCsdHnwGGyHg.png" /></figure><p>This is the final bit of the code. Basically, I’m adding the values from each channel to the lists, as well as the timestamps. After that, I’m plotting the data on the graph that I set up earlier. Finally, I’m yelling out if you need to concentrate or relax more, based on how high the concentration and relaxations measures are. And at the end, I’m calling the function again so it repeats multiple times and updates the information on the graph.</p><h3>Demo</h3><p>Here is a <a href="https://youtu.be/t_4FKpXuxmY">YouTube video</a>, where I give a brief overview of the project. Skip to 1:45 for the demo.</p><p>This project was really fun and helped me improve my python skills. My next project will be much more complicated and cooler than this, so stay tuned for that!</p><p><em>If you enjoyed this article, consider following me on </em><strong>Medium</strong><em> to see more of my content! If you have any questions feel free to reach out to me via </em><a href="https://www.linkedin.com/in/surya-sure-9ba9b2220/"><strong>LinkedIn</strong></a><strong> or email </strong><em>me at</em> suryasure734@gmail.com.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25f38afc0fdd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Played the Chrome Dino Game With My Brain]]></title>
            <link>https://medium.com/visionary-hub/i-played-the-chrome-dino-game-with-my-brain-5b0fd959113a?source=rss-3213a50aa3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b0fd959113a</guid>
            <category><![CDATA[bci]]></category>
            <category><![CDATA[openbci]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[brain]]></category>
            <category><![CDATA[brain-computer-interface]]></category>
            <dc:creator><![CDATA[Surya Sure]]></dc:creator>
            <pubDate>Wed, 22 Dec 2021 21:22:09 GMT</pubDate>
            <atom:updated>2021-12-26T08:16:30.285Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m sure everyone reading this article has played the Google Dino Game before. The one where the dino jumps over the cacti when your internet doesn’t work. I would be proud to say my high score in that game is 3000, but I bet someone reading this has 7000 or something. But the real question is what is your high score when playing the game with your brain? Because I was able to score a whopping 210 (which is very impressive) when playing this game by blinking instead of pressing space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*Xe037qQ1N2SeL_d7.gif" /><figcaption>A GIF of the dino game</figcaption></figure><h3>Getting data from my brain</h3><p>To play the game with my brain, I actually need my live brain data and use the signals that are produced when blinking to jump.</p><p>To record my data, I used a <strong>brain-computer interface (BCI). </strong>A BCI is a device that tracks your brain activity and sends it to the computer, allowing performing a task that you programmed it to do.</p><p>There are many types of data you can record with a BCI, but I used <strong>electroencephalogram (EEG)</strong> signals. These are the signals produced by the electricity generated by action potentials, which are sent through your nervous system when your brain wants to perform a function.</p><p>I used the <a href="https://shop.openbci.com/collections/frontpage/products/ganglion-board"><strong>OpenBCI Ganglion Board</strong></a> to record my EEG data, along with the <a href="https://shop.openbci.com/collections/frontpage/products/openbci-eeg-headband-kit">EEG Headband Kit.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*lskhJLx_3g76Q161.png" /><figcaption>Ganglion Board</figcaption></figure><p>The Ganglion Board has <strong>4 channels</strong>, meaning I can place 4 electrodes around my head and connect them to the board with wires. The data is live-streamed, which I can see through the <strong>OpenBCI GUI</strong>. For this task, I only needed to use 2 channels because blinking is a simple task and only requires you to record the frontal lobe of the brain, which is behind your forehead. The frontal lobe is responsible for executive functions, which include simple movements such as blinking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0L-LLMz7nEfqujKNVNrFw.jpeg" /><figcaption>Me wearing the headband kit</figcaption></figure><h3>Programming the output</h3><p>Obviously, getting the data isn’t enough. I have to actually translate the blinking signals into an output, which in this case, is the space bar, by programming.</p><p>To do this, I used the coding language <strong>Python</strong>. Python is used for a wide variety of tasks, but I worked with a specific library called <a href="https://brainflow.readthedocs.io/en/stable/#">BrainFlow</a>, which takes the data from my board in the form of an array and filters it. Once it’s filtered, I use another library called <a href="https://pypi.org/project/PyDirectInput/">pydirectinput</a>, which allows me to input a button from my keyboard, without me actually pressing it. So basically I say, “If there is a spike in the signals, then press space”, through the code.</p><p>My full code is in my <a href="https://github.com/SurjaHead/DIno-Game/blob/main/main.py">GitHub</a>, but I’ll break down my code into chunks and explain what each section does.</p><h4>Importing Packages</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ikKHGiOQxL-6oX9000XCzA.png" /></figure><p>In the first part of the code, I’m importing the libraries that I’ll need to use later on. NumPy and pandas are needed to work with arrays, which is the format that the EEG data is in when working with Python. The BrainFlow, BoardShim, and DataFilter libraries contain the functions that let you stream data from your board and filter it to remove noise.</p><h4>Assigning Values</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*kObtQWJpSBF_PUcXUUe_cg.png" /></figure><p>Here, I’m assigning values to certain variables. Each board has different setup variables and I copied down the variables for the Ganglion board from the <a href="https://brainflow.readthedocs.io/en/stable/SupportedBoards.html#ganglion">BrainFlow documentation</a>. The other values such as time_thres, max_val, vals_mean, and num_samples are for later in the code to deal with the maximum and average values of the data relative to the sampling rate, or how many times it records the data. The last part is telling the board to connect to the computer through Bluetooth.</p><h4>Preparation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*zczrAbJ61bzo_q3RP0UDrA.png" /></figure><p>This part of the code is preparing the board to collect the data. It starts the stream of the data and gives the computer 5 seconds to process the data.</p><h4>Calibration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*GWHWVmds864s92V-kAQG_g.png" /></figure><p>In this part, the computer is learning what happens to the data when I blink, so that it can detect it. The while loop is essentially saying that vals_mean is the average of all of the samples of data and max_val is the maximum value in the data. This helps set up the blink threshold, which is the difference between the maximum value and the average value. The blink threshold allows the computer to detect a blink when the values in the data go higher than the blink threshold.</p><h4><strong>Performance</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*yVWGkY2exFkRl0IQwY038A.png" /></figure><p>Finally, here, the second “if” statement is telling the computer to update the time as the data is received. The final “if” statement is telling the computer to press space if the difference between the current value and the average value goes above the blink threshold. At the end, we stop the data stream and disconnect the board from the computer.</p><p>If I run this program, my blinks will register as the space bar to my computer, so I can play the dino game.</p><h3>Demo</h3><p>Here is a video of me playing the game by blinking. You’ll probably notice that not all of my blinks register as jumps because there is occasional noise, which overshadows the blink signals. But most of the time, it did work.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.loom.com%2Fembed%2Ff1053420d01145a9a1ea8f33d6c535fb&amp;display_name=Loom&amp;url=https%3A%2F%2Fwww.loom.com%2Fshare%2Ff1053420d01145a9a1ea8f33d6c535fb&amp;image=https%3A%2F%2Fcdn.loom.com%2Fsessions%2Fthumbnails%2Ff1053420d01145a9a1ea8f33d6c535fb-00001.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=loom" width="1280" height="960" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a2473840eb7ae82176a6cf3503529f6/href">https://medium.com/media/9a2473840eb7ae82176a6cf3503529f6/href</a></iframe><p>And…THAT&#39;S IT! This was a very confusing and time-consuming project for me because I am completely new to coding and have never worked with BCI’s before. But now, I can work on more complicated projects since I know the basics, so expect more from me soon!</p><p><em>If you liked this article and want to follow my research, feel free to connect with me on </em><a href="https://www.linkedin.com/in/surya-sure-9ba9b2220/"><strong>LinkedIn</strong></a><strong> </strong><em>and follow me on</em><strong> </strong><a href="https://medium.com/@suryasure734"><strong>Medium</strong></a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b0fd959113a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/visionary-hub/i-played-the-chrome-dino-game-with-my-brain-5b0fd959113a">I Played the Chrome Dino Game With My Brain</a> was originally published in <a href="https://medium.com/visionary-hub">Visionary Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brain-Computer Interfaces x Virtual Reality — A Match Made in Heaven]]></title>
            <link>https://medium.com/visionary-hub/brain-computer-interfaces-x-virtual-reality-a-match-made-in-heaven-d7d90b931928?source=rss-3213a50aa3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7d90b931928</guid>
            <category><![CDATA[neuroscience]]></category>
            <category><![CDATA[brain]]></category>
            <category><![CDATA[vr]]></category>
            <category><![CDATA[bci]]></category>
            <dc:creator><![CDATA[Surya Sure]]></dc:creator>
            <pubDate>Thu, 04 Nov 2021 01:36:13 GMT</pubDate>
            <atom:updated>2021-11-24T11:31:36.710Z</atom:updated>
            <content:encoded><![CDATA[<h3>Brain-Computer Interfaces x Virtual Reality — A Match Made in Heaven</h3><p>I’m sure most of you have heard of <strong>virtual reality (VR)</strong>. But if you somehow haven’t, it’s a fully immersive computer-simulated environment that gives the user the feeling of being in a different environment. Essentially, it’s an alternate environment and completely digital. There are countless applications of virtual reality from immersive gaming, immersive entertainment, and potentially even virtual environments where you can interact with other people, similar to reality! But virtual reality is still not fully immersive since it doesn’t stimulate all of our senses. Is there a way to further immerse ourselves in a digital environment?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*7k5MeI0IFIDMPWBM" /><figcaption>Using a VR Headset</figcaption></figure><p>Enter BCIs.</p><p><strong>Brain-Computer Interfaces (BCIs)</strong> are not as popular or well-known as VR. However, they are just as cool, if not, even cooler than VR. A BCI is a system that connects your brain to a computer and allows it to interact with your brain. Using their thoughts, the user can perform various tasks on their computer. These actions can range from changing the volume to controlling video game characters. However, there are so many more insanely cool things we will be able to do in the future. Using BCIs, you will be much more immersed in a VR experience because you will be controlling everything with your brain instead of using VR controllers. Trust me, this is not a joke.</p><h3>So how do they work?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xglgEQRu5u4p3171.jpeg" /></figure><p>BCIs rely on signals that your brain emits called <strong>action potentials</strong>. Action potentials tell parts of your body to perform a function and are converted into waves which a computer can then interpret Based on the frequency of the waves, the computer can then perform the associated task. Basically, you are communicating with the computer, but you need to program the computer first to understand you.</p><p>There are three different types of BCIs:</p><ul><li><strong>Invasive</strong></li><li><strong>Semi-Invasive</strong></li><li><strong>Non-Invasive</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*sNPuqKrSOXTyG_ufdhq55Q.png" /></figure><h3>Going inside your brain…</h3><p>Invasive BCIs require electrodes to be <strong>implanted</strong> into the brain during <strong>neurosurgery</strong>.</p><p>I know it sounds crazy. You’re probably thinking “Why would anyone willingly put things inside their brain?”, and I would be in the same boat as you.</p><p>But hear me out, these BCIs have massive potential to completely change our lives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*lJIfFH10rcHpKI8l.jpg" /></figure><p>Within invasive BCIs, there are <strong>single unit</strong> BCIs, which detect signals from a small area of neurons, while <strong>multiunit </strong>BCIs detect signals from multiple areas. Since the electrodes are inside your brain, invasive BCIs can obtain the highest quality signal out of all other types of BCIs. The signal is taken directly from the cortex and transmitted to the computer without any noise or interference.</p><p>These BCIs can also stimulate your brain to make you feel something or to control your actions with <strong>neurofeedback</strong>, which is the process of sending signals to your brain. With nearly endless possible applications in the future, BCIs can potentially help with restoring vision, neurorehabilitation, and could even give us the ability to upload information to our brain🤯.</p><p>However, as you can expect with any invasive technology, there are some problems. When normal tissue is destroyed by either disease or surgery, there is a high risk of scar tissue forming in your brain, which puts pressure on your nerves. The surgery is also very expensive and requires extreme precision.</p><p>So far, this is the least developed and least researched type of BCI, for obvious reasons, so it is not ready to be integrated with VR yet.</p><h3>How about the surface of your brain?</h3><p>Semi-invasive BCIs are less extreme than invasive BCIs and don’t require electrodes to be implanted into your brain, but rather on the surface of your brain. So they still require an operation, but instead of neurosurgery, they require a <strong>craniotomy</strong>, which is a process where your head is opened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OQhDX1Z5blj7gUvX.png" /></figure><p>This sounds crazy too, but it’s way easier than neurosurgery.</p><p>The most common type of semi-invasive BCI is <strong>electrocorticography (ECoG)</strong>. ECoG requires electrodes to be implanted on the surface of your brain, lowering the risk that fully invasive BCIs propose.</p><p>ECoG signals have a high <strong>spatial resolution</strong>, which you can think of as the clarity of signals. It’s similar to the clarity of a picture; 480p (bad) vs 1440p (great). There is also no background noise from eye or muscle movements, resulting in high-quality signals.</p><p>Compared to invasive BCIs, ECoG has a lower clinical risk over time and is cheaper, which is a more appealing option to most people.</p><p>Semi-invasive BCIs have the best of both worlds, having close to the quality and clarity of the signals that invasive BCIs have but produce less risk and are cheaper, similar to non-invasive BCIs.</p><p>They also have a high potential for merging with VR since they produce high-quality signals without having to do a full surgery but right now, it’s still a developing science.</p><h3>No surgery, thank you.</h3><p>Right now, non-invasive BCIs are the most common and used for most consumer products that track brain activity. As you can guess, non-invasive BCIs are not invasive, which means they measure brain activity from outside your head.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*y34tPuUp3UOsAvco.png" /></figure><p>By far, the most common non-invasive BCI is <strong>electroencephalography (EEG)</strong>. EEG consists of electrodes being placed on your head, which is obviously safer and a much easier process than EcoG or invasive BCIs. EEG is quite easy to access as well because most consumer products that measure brain activity utilize EEG.</p><p>However, EEGs have limited use in more advanced BCIs because of their low signal quality. EEG devices produce low-quality signals with a lot of interference because they are further away from the brain. This is a major problem with future applications of BCIs which require the utmost precision and accuracy. For our current needs, however, non-invasive BCIs have the most value.</p><p>When it comes to VR, EEG devices are the easiest to integrate. The EEG electrodes can be attached to the VR headset, making it extremely simple to record your brain data while using the VR headset.</p><h3>Creating a BCI x VR game</h3><p>Combining BCI technology and VR seems so far away, but there are actually several games that currently exist which combine BCI and VR. One of these games is “<a href="https://www.youtube.com/watch?v=b2JWMZWdDCY"><em>Throw Trucks With Your Mind</em></a>” (it sounds so fun) and it was created by the company <a href="http://neurosky.com/"><strong>Neurosky</strong></a><strong>. </strong>Let’s dive into how a game like this is created.</p><p>Generally, the process of building a BCI is as follows: signal production, signal detection, signal processing, and signal output.</p><p><strong>Signal Production</strong></p><p>You need someone to actively produce brain signals for your BCI; the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*tx7koFva5NDmtio5AKdGxw.png" /></figure><p><strong>Signal Detection</strong></p><p>There are many methods to detect brain signals, but EEG is currently the most commonly used method. You use EEG electrodes and you would either place them on your head or on a muscle.</p><p><strong>Signal Processing</strong></p><p>Signal processing is a process of filtering out any noise interference in the EEG data, generally including your heart, muscle, or eye movement. It is produced by P300 waves, which represent involuntary brain activity. For this reason, we use filters and AI algorithms and filter the EEG data to extract the data we need.</p><p><strong>Signal Transduction</strong></p><p>Signal transduction is the step where you tell the computer what to do with your EEG data. You tell it how to interpret it and which task to perform. For example, you can program your computer to change the volume every time you flex your bicep. Essentially, you are assigning a physical activity to a computer task.</p><p>Since “<em>Throw Trucks With Your Mind” </em>relies on the user’s emotions. EEG data is tracked and classified more specifically. <strong>Neural oscillations</strong> are tracked as a means for measuring your excitement levels<strong>. </strong>Neural oscillations are brain waves that are classified based on what excitement level they are generated at and are listed as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*WnzxulBlsOxjKcLtcY94lw.png" /></figure><ul><li><strong>Gamma</strong> (32–100 Hz): Emitted during a life or death situation.</li><li><strong>Beta</strong> (13–32 Hz): Emitted doing work hours and problem-solving.</li><li><strong>Alpha </strong>(8–13 Hz): Emitted while relaxing or closing eyes.</li><li><strong>Theta </strong>(4–8 Hz): Emitted during sleep, daydreaming, and meditation.</li><li><strong>Delta </strong>(0.5–4 Hz): Emitted during deep sleep and meditation.</li></ul><p>Using these neural oscillations, Neurosky tracks your emotions and excitement levels during the game.</p><p>The final step to create the game is to change the input commands from peripherals to the EEG data. The actions within the game are based on your concentration levels and calmness, which are measured through your brain waves. If you emit beta or gamma waves, the game recognizes that you are concentrated on one action, which lets you access all abilities in the game. If you are not focused on one action, you emit theta or delta waves. The game decides what to do with alpha waves based on other factors.</p><p>But the essence of the game is that the more focused and you are, the more abilities you have that you can use with ease. If you lose that concentration, the game becomes more difficult.</p><p>I know this seems complicated, but we’re only scratching the surface of BCI integration with VR. Once we can make semi-invasive and invasive BCIs mainstream, VR technology will take a huge leap and I’m totally ready for it.</p><h3>Current Developments</h3><p>Similar to Neurosky, there are some companies working on BCI gaming:</p><p><strong>Valve</strong></p><p>Valve is one of the largest video game developers in the world. Some of their games which you may recognize are <a href="https://www.google.com/search?sa=X&amp;rlz=1C1CHZN_enCA929CA929&amp;biw=2560&amp;bih=1297&amp;sxsrf=AOaemvJfgubjSmmv-NMdfFzeaAklTJxWjQ:1637752461892&amp;q=Counter-Strike:+Global+Offensive&amp;stick=H4sIAAAAAAAAAONgFuLQz9U3SCnPMVLiArEyjAvKjKq0JLKTrfSTy9L10xNzU-NzE7NTi6xAzOJFrArO-aV5JalFusElRZnZqVYK7jn5SYk5Cv5paal5xZllqTtYGSewMQIAxiC-gVsAAAA&amp;lei=HR-eYbrUMaepptQP5fKmgAc"><strong>CS: GO</strong></a>, <a href="https://www.google.com/search?sa=X&amp;rlz=1C1CHZN_enCA929CA929&amp;biw=2560&amp;bih=1297&amp;sxsrf=AOaemvJfgubjSmmv-NMdfFzeaAklTJxWjQ:1637752461892&amp;q=Half-Life&amp;stick=H4sIAAAAAAAAAONgFuLQz9U3SCnPMVKCspLjtSSyk630k8vS9dMTc1PjcxOzU4usQMziRaycHok5abo-mWmpO1gZJ7AxAgBZB-TjQgAAAA&amp;lei=JyCeYaqzI-OZptQP4pSSgAY"><strong>Half-Life</strong></a> (yes, the entire series), and <a href="https://www.google.com/search?sa=X&amp;rlz=1C1CHZN_enCA929CA929&amp;biw=2560&amp;bih=1297&amp;sxsrf=AOaemvJfgubjSmmv-NMdfFzeaAklTJxWjQ:1637752461892&amp;q=Portal+(video+game)&amp;stick=H4sIAAAAAAAAAONgFuLQz9U3SCnPMVLiBLHS0rPKSrQkspOt9JPL0vXTE3NT43MTs1OLrEDM4kWswgH5RSWJOQoaZZkpqfkKIFHNHayME9gYAei26KpNAAAA&amp;lei=SyCeYdaXBYuhptQPjNeHkAk"><strong>Portal</strong></a> (1 and 2). Most of their games were released in the 2000s or the early 2010s, but my point still stands. Currently, they are working with OpenBCI to build a fully-immersive gaming experience. The thing that sets this idea apart is that Valve plans to use neurofeedback to allow the user to receive sensory information from the virtual world. This would completely alter the field of gaming and could lead to a completely new and unforeseeable future.</p><p><strong>Neurable</strong></p><p>Neurable is one of the biggest companies in the BCI industry and plans to advance this technology by VR gaming. Neurable currently sells headphones to track concentration and help with focusing, but they are researching using BCIs with VR. With the idea of making the UI/UX of VR more accessible and easy to use, while also focusing on gaming, they are using event-related potentials for their BCI because they show what the user is intentional about. They have already developed a prototype of this at SIGGRAPH, a tech conference in Singapore:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F47WHqDNckI8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D47WHqDNckI8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F47WHqDNckI8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/dff2086aa112e88081c2cbf700d8c30b/href">https://medium.com/media/dff2086aa112e88081c2cbf700d8c30b/href</a></iframe><h3>TL;DR</h3><ul><li><strong>Brain-computer interfaces (BCI)</strong> can make <strong>VR</strong> much more immersive</li></ul><p>BCIs rely on signals called <strong>action potentials</strong>, which your brain generates to perform a function</p><ul><li>There are 3 types of BCIs: invasive, semi-invasive, and non-invasive</li><li><strong>Invasive BCIs</strong> produce the highest quality signals, but require neurosurgery and are very expense</li><li><strong>Semi-invasive BCIs</strong> produce signals with no interference but require a craniotomy</li><li><strong>Non-invasive BCIs</strong> produce signals with a lot of interference and low clarity, but they are cheap and easy to use</li><li>The steps to create a BCI x VR game are <strong>signal production, signal detection, signal processing, and signal transduction</strong></li><li>A company called <a href="http://neurosky.com/"><strong>NeuroSky</strong></a> created a BCIx VR game called <em>“</em><a href="https://www.youtube.com/watch?v=b2JWMZWdDCY"><em>Throw Trucks With Your Brain</em></a><em>” </em>and it tracks neural oscillations</li><li><strong>Neural oscillations</strong> are brain waves classified based on the frequency of the waves and the task or scenario that produces those waves and they are divided into Delta, Theta, Alpha, Beta, Gamma</li><li>Semi-invasive and invasive BCIs have a lot of potential in the future to be integrated with VR</li><li>Some of the largest companies working on BCI x VR integration are Valve and Neurable</li></ul><p>There you have it! These are the basics of BCI integration with VR. It seems so futuristic, but we already developed several products in this field. Nonetheless, We are just scratching the surface of what we could do in this fascinating field.</p><p><em>If you enjoyed this article, it’d be great if you can share it with your friends and family and give me a clap!</em></p><p><em>For more content like this, consider following me on </em><a href="https://medium.com/@suryasure734"><strong>Medium</strong></a><em> and connecting with me on </em><a href="https://www.linkedin.com/in/surya-sure-9ba9b2220/"><strong>LinkedIn</strong></a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7d90b931928" width="1" height="1" alt=""><hr><p><a href="https://medium.com/visionary-hub/brain-computer-interfaces-x-virtual-reality-a-match-made-in-heaven-d7d90b931928">Brain-Computer Interfaces x Virtual Reality — A Match Made in Heaven</a> was originally published in <a href="https://medium.com/visionary-hub">Visionary Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brain-Computer Interfaces in a Nutshell]]></title>
            <link>https://medium.com/visionary-hub/brain-computer-interfaces-in-a-nutshell-3a2fa48375a5?source=rss-3213a50aa3d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a2fa48375a5</guid>
            <category><![CDATA[brain-computer]]></category>
            <category><![CDATA[bci]]></category>
            <category><![CDATA[computers]]></category>
            <category><![CDATA[brain-computer-interface]]></category>
            <category><![CDATA[brain]]></category>
            <dc:creator><![CDATA[Surya Sure]]></dc:creator>
            <pubDate>Sun, 03 Oct 2021 22:16:55 GMT</pubDate>
            <atom:updated>2021-10-04T13:36:26.827Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XD-qPwsNnEowro1s.jpg" /></figure><p>Telekinesis has been a common theme in the sci-fi genre for several decades now. I’m sure at some point in your childhood, you’ve dreamed about being able to control objects with your mind. It was always the TV remote for me. Well guess what? You will be able to do EXACTLY that in the near future❗❗</p><p>Now, you’re probably thinking, “wait…WHAT!?”, and I would completely understand. The concept of telekinesis seems so far off. However, we are unbelievably close to achieving it, thanks to the power of brain-computer interfaces (BCIs).</p><h3>What exactly is a BCI?</h3><p>In simple terms, a BCI is a system that connects your brain to a computer and allows it to interact with your brain. The computer tracks the electric signals emitted by your neurons and performs the task it is programmed to do based on the magnitude of those waves. This requires a program written on the computer to tell it how to interpret the waves along with a device to record your brain waves. You can think of your brain as a controller that you’re plugging into the computer.</p><h3>A bit about the brain…</h3><p>To understand the functionality of a BCI and how it works, you‘ll need to understand how the human brain functions. Consider this a free biology lesson;</p><p><strong>Membrane Potential</strong></p><p>Membrane potential is the difference in electrical charge between the inside and outside of a neuron.</p><p>The difference in charge develops through the grouping of ions (elements or compounds that have extra protons or electrons) in the inside and outside of the membrane. When a neuron is at rest, there are more sodium and chorine ions outside of the cell and more potassium and organic anions (negatively charged ions) inside of the cell. Since there are more anions inside of the cell than outside, the membrane potential would be negative. The magnitude of the membrane potential of a resting neuron is generally around -70 millivolts. There is a transport protein called the sodium-potassium pump which continuously pumps 3 sodium ions outside of the cell and 2 potassium ions into the cell. This is what maintains the negative membrane potential.</p><p><strong>Neurons</strong></p><p>So, there are about 85 billion neurons in our brain. A neuron is a nerve cell and is the primary functional unit of our nervous system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w_UbC0SRy0j-UWGi.jpg" /></figure><p>There are parts looking like tree branches that are sticking out of the neuron which are called <strong>dendrites</strong>. The dendrites are the area where neurons receive most of their information. There are receptors on dendrites that are designed to pick up signals emitted by other neurons which are in the form of a chemical. This chemical is called <strong>neurotransmitter</strong>. It’s similar to how humans communicate: the words we say are the signals, but they are emitted in the form of sound.</p><p>The signals cause electrical changes in the neuron which are interpreted in the cell body of the neuron, called the <strong>soma</strong>. The soma’s job is to take info gathered by the dendrites and put it in a place called the <strong>axon hillock</strong>, which is right in front of the axon. If the signal is strong enough, it gets sent down to the <strong>axon</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*Z6LJftIc-BtfOUCy" /></figure><p>A signal that is travelling through the axon is called an <strong>action potential. </strong>The axon is covered with<strong> myelin</strong>, a material that prevents the signal from degrading. The signals stay intact in the axon because of myelin.</p><p>Finally, the action potential reaches the <strong>axon terminals,</strong> which causes the release of neurotransmitter. Dendrites of another neuron are connected to the axon terminals, which is how the dendrites receive the neurotransmitters.</p><p>This process repeats for many neurons until the signal reaches where it needs to.</p><p><strong>Action Potential</strong></p><p>I already defined what an action potential is in neuron anatomy, but it can be related to membrane potential.</p><p>An action potential is the momentary reversal of membrane potential. When neurotransmitter binds receptors on the dendrites, it causes the neuron to depolarize. Depolarization is when the membrane potential of a neuron gets closer to zero. Repeated depolarization causes the neuron to reach its threshold membrane potential, which is generally around -55 millivolts.</p><p>When a neuron reaches threshold, a large number of sodium channels open, releasing positively charged sodium ions into the cell. The influx of positive ions causes the membrane potential to become positive. When it reaches its peak, it is known as the action potential. Once the membrane potential peaks, the negative ions come back into the cell, causing the membrane potential to fall back to its original value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*tVJG28WG3cArDlqI.png" /></figure><h3>Tracking Brain Activity</h3><p>Ok, now that you have learned a bit about the brain (looking back at it, that is a lot more than just a bit, but I’ll go with it) and how it functions, I’ll explain how the computer tracks your brain activity.</p><p>Electroencephalography (EEG) and Electrocorticography (ECoG). You’re probably looking at those and FREAKING out. It’s fine, I did too when I first saw these words. I mean, WHO ON EARTH would think of these complicated words???😭 Let&#39;s be honest, they thought they would look smart if they used these big words. But don’t worry. The concepts those words describe are way easier to comprehend than the words themselves.</p><p>Electroencephalography (EEG) and electrocorticography (ECoG) are the two most commonly used techniques we currently have to measure brain activity. The data acquired from these measurement techniques is fed into a program, which then processes the data to perform a task.</p><p><strong>EEG</strong></p><p>EEG is used to measure the electric activity of your brain. Electrodes are placed on the scalp of a patient. These electrodes detect the electrical activity of neurons in the cerebral cortex. Instead of detecting the activity of single neurons, the electrodes detect the activity of large groups of neurons that are active at the same time. They primarily measure postsynaptic potentials which are changes on the receptors of dendrites that trigger action potentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XebvRc-l8v0lXM9r.jpg" /></figure><p>EEG provides the electrical activity in the brain represented as waves of varying shape, amplitude, and frequency. This data can be used to measure brain activity during a spontaneous event.</p><p>This data is then input into a program that processes the data and performs a task. EEG cannot be used when not connected to a device since there will be nothing tracking brain activity.</p><p>Advantages</p><ul><li>Variety of clinical applications: diagnose epilepsy, characterize seizure activity, etc.</li><li>Low cost</li><li>Measures activity within milliseconds</li></ul><p>Disadvantages</p><ul><li>Poor spatial precision</li><li>Limited ability to accurately record form structures deeper than the cortex</li></ul><p><strong>ECoG</strong></p><p>ECoG is very similar to EEG in that it requires electrodes to measure a patient’s brain activity. However, instead of placing electrodes on the patient’s scalp, the electrodes are placed inside the patient’s head, in direct contact with the cerebral cortex (surface of the brain). This is done during surgery since precision is important when placing electrodes inside your brain. A BCI using ECoG is known as invasive BCI since the electrodes go inside your brain. Invasive BCIs are not necessarily bad as they have more precise measurement than non-invasive variants, but they do pose a higher risk</p><p>Advantages</p><ul><li>Higher spatial and temporal resolution than EEG</li><li>Allows for direct stimulation of the brain</li></ul><p>Disadvantages</p><ul><li>Limited sample time</li><li>Limited field of view</li><li>Invasive technology, so a malfunction could cause neural damage</li></ul><p>Both of these techniques are very similar to a fitness tracker. They just measure brain activity instead of steps, heart rate, and calories burned. Tracking your brain data is the first half of creating a BCI. The second half is the connection with the computer.</p><h3><strong>Connection with a Computer</strong></h3><p>So EEG and ECoG track your brain activity. But what does the computer do with that information?</p><p>For basic BCIs, it’s pretty easy to understand. First, you write a <strong>program</strong> on the computer. This program is telling the computer what to do with the brain activity data. It is usually written in <strong>python</strong>. The data is tracked through a brain-sensing <strong>apparatus</strong> such as the <a href="https://choosemuse.com/">Muse</a> headband. The Muse headband connects to a computer via Bluetooth, so that step is fairly easy.</p><p>Once the headband is connected, you can start tracking your activity through an application. As you are actively tracking your brain activity, if you run the program, it will perform the task you designed it to do.</p><p>The program is designed to give commands to the computer on how to interpret the brain data. “If it is this amplitude, do this.” You are essentially telling the computer to perform a task when you perform an action. These <strong>actions</strong> can be very simple, like blinking, simple jaw movements, raising your hand, etc. Based on your program, you can just think about the task that you want to do and it will work. As such, the <strong>tasks</strong> that simple BCIs can perform are also simple, like changing the computer volume, controlling a 2D game character (snake, for example), and typing. That being said, you can certainly make the computer perform a more challenging task if you write a program to do so.</p><p>Here are some students who have made a BCI:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrKk8YW4yS4g%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrKk8YW4yS4g&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrKk8YW4yS4g%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7cbee71b9ae507509b29e5637422e061/href">https://medium.com/media/7cbee71b9ae507509b29e5637422e061/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FtnWXIak2RqM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DtnWXIak2RqM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FtnWXIak2RqM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/98bda4fa875f894c337927fa8c45fc18/href">https://medium.com/media/98bda4fa875f894c337927fa8c45fc18/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FTFArCKhnbuY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTFArCKhnbuY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTFArCKhnbuY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f9abe86947942eabf7b6fb406abafbd/href">https://medium.com/media/5f9abe86947942eabf7b6fb406abafbd/href</a></iframe><p>BCIs may seem very complicated, but it’s really not hard to make one. You can try making one yourself! You just need a Muse headband and need to know how to code with python. 😃</p><h3><strong>Applications of BCIs</strong></h3><p>Now that you know how BCIs function, what are their applications?</p><p>BCIs have many applications right now and even more potential applications in the future. From clinical uses to video games, BCIs can be applied to a wide variety of fields and will soon become a large part of our daily lives. Here are some of the current uses:</p><ul><li>Being able to control prosthetic limbs</li><li>Neural rehabilitation for serious injuries</li><li>Detection and diagnosis of tumors</li><li>Controlling game characters with your mind</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*NAiEvlfzpRt_YbS6" /></figure><p>And here are some potential future applications:</p><ul><li>Controlling objects with your mind</li><li>Controlling characters in a VR game</li><li>Communicating without speaking</li><li>Downloading information</li><li>Help disabled people interact with devices and objects</li></ul><p>We are obviously nowhere near having these capabilities right now, but with the speed that research is progressing at, we could very well have these features within 50 years. To help you understand why it would take so long, let me give an example. Downloading information probably sounds insane and unrealistic to you. And right now, you would be right. However, scientists already have an idea of how they could possibly develop a system that does this.</p><p>They think we could possibly stimulate certain regions of the brain, using electrodes that are wirelessly connected to a device. This would give the brain new information. To do this, we would have to develop a deeper understanding of the human brain and we would need to develop a complicated algorithm that safely stimulates the brain to provide exactly the information that we want it to have. The company Neuralink is already researching this!</p><p>Yeah, you see my point. The future applications are only shown in sci-fi films, but they could become a reality! The possibilities for what we can do with BCIs are endless.</p><h3>Industry Leaders</h3><p><a href="https://neuralink.com/"><strong>Neuralink</strong></a> is a company run by Tesla founder, Elon Musk, that aims to merge humans and machines to keep humans ahead of AI. They are the leading industry experts in BCIs and are ahead of other companies with their technology. Currently, they are the first company to design a neural implant that will let you control a computer or mobile device anywhere you go. This technology is called neural lace. This technology is as small as a neuron and multiple of them are inserted into your head through precise brain surgery. This is just a sneak peek of what’s ahead as Musk has stated that they are working on being able to merge humans and AI by having access to a computer in your brain. Through this, you can do INSANE things like downloading information and storing memories!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FlA77zsJ31nA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DlA77zsJ31nA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FlA77zsJ31nA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c23315c6242441c036c941d593ae8652/href">https://medium.com/media/c23315c6242441c036c941d593ae8652/href</a></iframe><p><a href="https://neurable.com/"><strong>Neurable</strong></a><strong> </strong>is a startup company run by Ramses Alcaide that is building a virtual reality headset that allows the user to have complete control over the game character. They are trying to make the headset interpret human intent and measure emotion. They are using machine learning to interpret EEG signals and convert them to human emotions and intent. I would love to try a VR game like this. Although they are working on this, their primary goal is to make neurotechnology universally accessible.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVNx9hKeYuc0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVNx9hKeYuc0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVNx9hKeYuc0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0741ddb33b1914d2ec45afd26d713287/href">https://medium.com/media/0741ddb33b1914d2ec45afd26d713287/href</a></iframe><p><a href="https://www.neuropace.com/"><strong>NeuroPace</strong></a><strong> </strong>is a company that is developing a system that monitors ECoG data to send electric stimulus data when there is abnormal brain activity. The system has a battery pack that records and stimulates with electricity and it also has electrodes placed inside the brain. Their goal is to be able to diagnose and treat seizures before they happen. When a seizure is about to develop, pulses are delivered to prevent the seizure, but the person can’t feel the pulses, so it’s completely safe.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2QLvuVqfNsA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2QLvuVqfNsA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2QLvuVqfNsA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/061f31c87099bfbe3de9d02ed7d4746f/href">https://medium.com/media/061f31c87099bfbe3de9d02ed7d4746f/href</a></iframe><p><a href="https://www.emotiv.com/"><strong>EMOTIV</strong></a><strong> </strong>is a company aiming to track cognitive performance, monitor emotions, and control both virtual and physical objects via machine learning of trained mental commands. The applications for their technology span across many fields. They are already selling gear to detect stress, focus, and more. They use cloud-based technology to store their user information so it has a low risk of getting leaked.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FoOcRZo5vgXI&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DoOcRZo5vgXI&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FoOcRZo5vgXI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/da35b07f8a37875410018f3133ea7582/href">https://medium.com/media/da35b07f8a37875410018f3133ea7582/href</a></iframe><h3>Potential Risks of BCIs</h3><p>Although BCIs are insanely cool and have a wide variety of applications that are very beneficial, it also has some risks, like any other technology. These are some of the risks that BCIs can possess:</p><ul><li>Invasive BCIs can have ill effects on the brain</li><li>Viral attacks</li><li>Requires precise neurosurgery</li><li>Malfunction in a model of BCIs can cause many deaths</li><li>Can be lethal when used with malicious intent</li></ul><p>These are all very plausible risks that BCIs can possess and with the development of telekinesis and telepathy, there could be some currently unimaginable risks in the future.</p><h3>TL;DR</h3><ul><li><strong>BCI</strong> is a system that connects your brain to a computer and allows it to interact with your brain</li><li>Signals sent between dendrites of neurons are called action potentials</li><li><strong>Action potentials</strong> are a momentary reversal of<strong> membrane potential</strong>, which is the difference in electrical charge between the inside and the outside of a neuron</li><li><strong>EEG</strong> is used to measure electrical activity in your brain by placing electrodes on your skull</li><li><strong>ECoG</strong> is used to measure electrical activity in your brain by placing electrodes in direct contact with your cerebral cortex</li><li>The brain activity data is interpreted by the computer to perform a task it is programmed to do</li><li>BCIs have a variety of applications currently and have will sci-fi-like applications in the future</li><li>Some of the leading companies in BCI research are <strong>Neuralink</strong>, <strong>Neurable</strong>, <strong>Neuropace</strong>, and <strong>EMOTIV</strong></li><li>BCIs possess several risks such as viral attacks and ill effects on your brain</li></ul><p>There you have it! That was my overview of BCIs. Now that you know the basics of BCIs, think about how you could achieve telekinesis.</p><p><em>If you enjoyed this article, it’d be great if you can share it with your friends and family and giving me a clap!</em></p><p><em>For more content like this, consider following me on </em><a href="https://medium.com/@suryasure734"><strong>Medium</strong></a><em> and connecting with me on </em><a href="https://www.linkedin.com/in/surya-sure-9ba9b2220/"><strong>LinkedIn</strong></a>!</p><p>Stay tuned for more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a2fa48375a5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/visionary-hub/brain-computer-interfaces-in-a-nutshell-3a2fa48375a5">Brain-Computer Interfaces in a Nutshell</a> was originally published in <a href="https://medium.com/visionary-hub">Visionary Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>