Backyard Brains Logo

Neuroscience for Everyone!

+1 (855) GET-SPIKES (855-438-7745)

items ()

Poker Bot to Detect Bluffs From Your Sweat Glands and Heart Rate

Poker Bot to Detect Bluffs
Arduino Seeeduino in action!

—Written by Sachin Pillai—

Lo and behold, somehow I’m already five weeks into the BYB fellowship program this fine summer. At this point, the only bluff I’ve certainly encountered is just how fast time can pass! Just kidding. I have in fact made significant progress with my Poker Bot over the past weeks and that includes bluffs within poker games, as well.

The trajectory of my project has been rather surprising. Some days, progress moves like the wind, while other days I feel like I’m stuck in a mucky pond unable to take even the slightest step forward. These past weeks have definitely been a character building bonanza.

As I mentioned in my introductory blog post, I first sought out to build my bluff-detecting risk-assessing poker bot by utilizing EEG signals from the brain. Working with these brain waves turned out to be significantly challenging and I altered the approach of my project to focus on the galvanic skin response and EKG signals in conjunction.

That is where I thought my project was headed only TEN days ago! I was progressing quite nicely and was even able to collect data that contained both GSR and EKG intervals. The image below contains two streams of data. The red line is the galvanic skin response while the green line is my EKG signal.

poker bot to detect bluffs from sweat reponse and heart rate
Red line: Galvanic Skin Response (GSR) or sweat response. Green line: EKG (Electrocardiogram) signal – heart rate

However, after a lot of debate and discussion, my EKG+GSR data collection technique unfortunately came to rest. I decided that the features between different EKG signals of stress and no- stress environments were very similar to each other and only vary in the frequency of the waves that show up. (This can be measured as the distance between the peaks of adjacent waves and is actually how a pulse is determined from an EKG signal. Besides that, the shape of an EKG signal stays very consistent.)

The idea behind utilizing an EKG signal for my project was that in scenarios of bluffing, the EKG pulse rate will increase and complement the stress response seen by the GSR data. Using multiple modes of data will hopefully improve the accuracy of my eventual machine learning model. As you might have noticed, the only feature I’m truly extracting from my EKG data is the pulse rate. Why couldn’t I just utilize a separate sensor that solely measured pulse rate and use that data instead? Not surprisingly, that is exactly what I did. The sensor I used is shown below and is exactly what I was hoping for.

SeeedStudio sensor
Source: SeeedStudio

This new pulse monitor was especially useful since it utilized infrared detection of heart rate and, thus, was much more accurate in instances of any potential noise such as hand movement and/or shaking. For comparison, an EKG signal would have been significantly interrupted by any form of shaking. Since I would be taking data from people playing poker, I really needed a method of data collection that would not be adversely affected by simple movements. (“Science commands thee: Sit still!” might have worked too, but I am not a fan of such Draconian measures.)

So my next challenge was to determine a method of data collection for my GSR and pulse rate that would show up in Spike Recorder.

I attempted to retrieve this data using the Arduino Nano 33 BLE Sense module. Unfortunately, this specific Arduino board saw significant compatibility challenges with my pulse rate sensor. This was because my pulse rate monitor outputted a signal with 5V whereas my Arduino Nano 33 BLE Sense required an input signal of 3V. Yet another challenge had faced me, and yet another solution I was required to solve.

I played around with several factors including wire connectivity strength, sensor type, and finally the board version to see how I could possibly retrieve my GSR signal with my pulse rate data. The solution came to me through the small contraption you can see above (scroll up to the top of the post).

The board used here is an Arduino Seeeduino. It is known for all of its various input ports which gives me a lot of flexibility and freedom to apply it for what I need it to do. This board was quite a breakthrough because after much trial and error, I was finally able to capture a full data set containing accurate GSR and pulse rate signals! A screenshot from Spike Recorder is displayed here with the GSR signal above the pulse rate.

Now that I’ve finally been able to get both data streams showing up on Spike Recorder, I’ve reached a significant milestone. I now have the capabilities to take full sets of data from people playing poker. My plan for the upcoming days is to collect this data from myself and others and begin building a large dataset. Once I’ve generated a strong enough set, I will then begin the process of creating my AI neural network. The pieces of my project are slowly but surely coming together and I couldn’t be happier!

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.