instagram

Sunday, March 12, 2017

EMG Chase Game

I dusted off SparkyEEG recently and used it for some fun with EMG processing, as well as an excuse to do some learning with TensorFlow and deep learning (as an aside I read the Deep Learning Book by Goodfellow et al. and really enjoyed it). I placed the 8 electrodes across various muscles, mostly around shoulders.

I'm using some fairly simple (and common) preprocessing on the raw electrophysiology data to first get the EMG power. This applies a bandpass filter, rectification, and then measures the "waveform length" which is the integral of the absolute value of the difference.


Representation learning

First I wrote up an autoencoder (and then a variational autoencoder) to take some EMG data and perform unsupervised dimensionality reduction. It also helps denoise the data and remove things like EKG contamination.



And here are some graphs of the latent variables learned



Arm movement tracking

Then I used my kinect to record my arm positions while recording EMG data in parallel. I used the a neural network to predict my arm positions based upon the EMG data.



And again here is a graph of the reconstruction (the data after 150s is held back test data), sorry for the time shift.


Game

Then sort of putting this all together I wrote a game to chase a maker using EMG activity. The way this works is first prelearning a representation using a variational autoencoder as I sit and move my arms around. These graphs are from the tensor board that shows the log likelihood of the data improving and the Kullback-Liebler divergence of the latent space increases (the total lower bound does continue to increase). I should probably run it for longer as it hasn't stabilized, but it gets a bit boring :).




Then I start playing a game which adds a linear network to the output of the latent space to try and predict the X and Y positions of the cursor. Here you can see the mean squared prediction error improves while playing the game and then stabilizes after a while. The residual noise appears to be mostly high frequency noise. The learning function initially learns just the output network but then after enough time to initialize that can back-propagate through the representation layer to try and improve the representation.


Here is a video of me playing this game and how well it does. Not perfect but not bad for a first implementation I wrote up an autoencoder (and then a variational autoencoder) to take some EMG data and perform unsupervised dimensionality reduction. It also helps denoise the data and remove things like EKG contamination.


While playing it's basically co-learning with the user, as you pick some movements to try and control the cursor and keep sticking with it, and it tries to map from those movements to the cursor position. It will take some exploring to figure out the right dynamics to try and let it optimally bootstrap this system. For example:

1. picking the set of cursor position where the decoder is most uncertain
2. how long should the memory buffer be to stabilize the system versus to allow it to evolve
3. how should the learning rate of the network adapt with time.

13 comments:

  1. Hey James,

    is there a way to replace the ADS1299? it is too expensive.

    can i ask the availability and cost of sparky eeg?

    Thanks..

    ReplyDelete

  2. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
    best kitchen sinks providers in Guntur

    ReplyDelete
  3. Sample Assignment is the leading brand in Australia and know for their work that offers complete online assignment services like contract law assignment, it assignment help, financial assignment help, project management assignment, electrical engineering help and more. Those students who looking for assignment help  Melbourne, Adelaide, Perth etc

    ReplyDelete
  4. Thanks for your informative content. It's extremely useful to students for further research and assistance. However, there is an academic assignment help provider that goes by the name TutorVersal, who has been offering various assignment writing services like Essay Help services, report writing services, case study services et cetera. The company has delivered thousands of assignments in which students scored high-distinction grades. They have never let any student down and in addition, offers various essay writing help services in subjects like management, nursing, law, engineering, and more. They constantly strive to provide the best academic solutions at the cheapest price as they know how difficult it is for a student to manage such expenses. Thus, any students who feel helpless in their academic assignments can avail prime assignments services at Tutorversal.com.

    ReplyDelete
  5. For nursing students, it gets a bit difficult to even make time to content an online assignment help providing company for nursing assignment help. Which is why, we, at Online Assignment Expert have extended our assignment help services which only exist in order to make it more convenient for the nursing students to fetch assignment solutions from an online assignment help company. Therefore, in order to avail our nursing assignment help offering no plagiarism, Free Turnitin, Partial Payment, Unlimited Revisions, etc. You can contact our team of highly professional, experienced, PhD experts to avail the discounted services!

    ReplyDelete
  6. Hey, do check out our Cryptography assignment help provided by the subject experts at TutorVersal. We are an online assignment help provider who assists students in overcoming their assignment writing challenges. Our highly qualified team of academic helpers write quality assignments that are 100% plagiarism-free and deliver them right on time. Recently, we launched child care assignment help service, and it has got a favorable response from hundreds of students in Australia who used it. We provide assignment solutions for over 180 subjects such as management, economics, nursing, engineering, and more. You can easily get your essays, dissertations, and case study assignments solved by us and score excellent grades in them!

    ReplyDelete
  7. Hello. I appreciate your concern. However, there are numerous Australian assignment help service provider in Australia that are offering their professional assistance to students in their academic assignments.
    Though, I would like to suggest you about an assignment writing service provider that goes by the name My Assignment Help Oz. MAHOZ consist of a specialised team of experts who knows everything about marking rubrics and formats. Also, the team of experts are PhD holders from reputed universities in Australia and knows every microscopic detail about their respective course study.
    Thus, they can provide students with best Australian Assignment help services.
    In addition, the team of writers claims to be best in preparing: essays, reports, articles, dissertations, theses, case study etc. They also acquire knowledge in various subjects like management, nursing, accounting, psychology, engineering etc.
    Thus, all who availed their services are pretty much satisfied and mostly all the students are very happy with the kind of quality solutions that they prepare, well-before stipulated deadlines, making them prime Australian assignment help provider.

    ReplyDelete
  8. Hello, it is a great write-up that, I am sure, will add a lot of value to the students and their assignment writing process. Laden with well researched content, the students will get a lot of things to learn. And the students who are looking for a reliable and cheap assignment help Australia service, My Assignment Services is the destination for them. I am academic expert having more than 10 years of industry experience and 5 years of assignment expert. I know what it takes to write an assignment that has the ability to fetch high grades. Our experts know how to make a boring assignment question unique and original. This is why we are the number one assignment provider for all university going students.

    ReplyDelete


  9. COPE TECHS is an organization of Technology experts��️�� with the aim to help individuals with solving Technology difficulties. We offer the best hacking services as well as our aim is not for Theft purpose but to help individuals overcoming Technology issues with our skills.

    ✴️For example-: There are so many individuals out there who owe a lot of debts���� to Banks and other Loan Firms and are working hard ��️⚒️to pay back but really can't pay. That's were our help can come in. We have designed a platform that have been helping so many in extracting crypto currency�� such as Bit Coin, Lite Coin e.t.c

    ✴️Another Example of our service-: A Man or Woman who suspects his/her Spouse of Cheating but have no prove, we could help by HACKING the Spouse Cell phone�� so he/she could get access to Chats, Emails��, Location��, Phone calls ��and text message✉️ of the Spouse anywhere they are.

    Other services we offer are-:
    ✴️Recovery of Lost Bitcoin in binary auctions��
    ✴️ Changing of Grades from Universities.��
    ✴️ Detection of weakness in Computer system security⚛️
    ✴️Funding a PayPal account����
    ✴️Cyber Attacks☣️ and lots more

    Put this on your mind, "AS LONG AS IT'S TECHNOLOGY, IT CAN BE HACKED"

    We belong to the HACKERS forum HackerOne and we have the Top hackers in the forum always ready to take the risk and do a job.

    If you need hacking Services, contact-:
    COPETECHS@GMAIL.COM

    We look forward to hacking for you.

    ReplyDelete
  10. This blog is so informative. After reading this blog, I have actually come to know why students come up with queries such as “do my assignment for me” and more. It is all because they not only have shortage of time in their lives, but also because they lack some or other writing skills that are needed in solving such assignments.

    So, whenever I decide to pay someone to do assignment, I always rely upon My Assignment Services. This is because when you pay to do assignment, this firm always lives up to your expectations. They not only offer an extensive range of academic consultation services, but also offer you with a wide range of value-added services such as the live one-on-one session with the experts, free copy of the Turnitin report, free editing and proofreading services and many more.

    So, I always take my “do my assignment for me” queries to this firm.

    ReplyDelete
  11. You need not to worry any more, we are here to offer you the best academic writing
    Solutions; order quality research paper writing company from us and learn how to write a nursing research paper today!

    ReplyDelete