{"id":7408,"date":"2021-01-27T14:23:03","date_gmt":"2021-01-27T14:23:03","guid":{"rendered":"http:\/\/ismiletechnologies.com\/?p=7408"},"modified":"2022-12-09T00:44:16","modified_gmt":"2022-12-08T19:14:16","slug":"finding-consumer-preference-using-eeg-signals","status":"publish","type":"post","link":"https:\/\/ismiletechnologies.com\/en_us\/dataops\/finding-consumer-preference-using-eeg-signals\/","title":{"rendered":"Finding consumer preference using EEG signals"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"7408\" class=\"elementor elementor-7408\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-022075a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"022075a\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-a75e4d0\" data-id=\"a75e4d0\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6ec615a elementor-widget elementor-widget-text-editor\" data-id=\"6ec615a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>EEG (electroencephalogram) signals are widely used to analyze consumer response in Neuromarketing. When compared with fMRI (Functional Magnetic Resonance Imaging), EEG cannot detect deep responses and exact positions of where the activity occurred but it can track changes in fractions of seconds. The setup is much cheaper and more easily usable than fMRI.<\/p><p>We are going to build a model that uses EEG signals recorded while the participants were shown various consumer products like shirts, gloves, etc. to learn consumer preference.<\/p><p>Dataset:<\/p><p>The EEG signals of volunteers of varying age and gender were recorded while they browsed through various consumer products. The users also reported their response as \u2018Like\u2019 or \u2018Dislike\u2019 for each product.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-8dba39f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"8dba39f\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3e57085\" data-id=\"3e57085\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-162a211 elementor-widget elementor-widget-text-editor\" data-id=\"162a211\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<ul><li><strong>Participants:<\/strong>\u00a025<\/li><li><strong>Products:<\/strong> 42 images (14&#215;3) 14 products with 3 varieties \u00a0<\/li><li><strong>Feature shape:<\/strong> 1024x512x14<\/li><li><strong>EEG Channels:<\/strong> 14<\/li><li><strong>Data points:<\/strong> 1024<\/li><li><strong>Label Distribution: <\/strong>580 Likes &amp; 444 Dislike<br \/><br \/><\/li><\/ul><p>The EEG signals are recorded using sensors connected to the human scalp. There are multiple sensors each of which captures responses from different parts of the brain. Thus, we have numerous signals available for each product viewed by the participant.<\/p><p>The figure below shows some of the sample EEG graphs of consumer responses to viewing products.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-048121d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"048121d\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ff0a272\" data-id=\"ff0a272\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3cddc28 elementor-widget elementor-widget-text-editor\" data-id=\"3cddc28\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Pre-Processing:<\/p><p>We use the Standard Scaler Algorithm for preprocessing. The mean and standard deviation is obtained from the training data and then the training and test data are scaled down using the training mean &amp; standard deviation.<\/p><p>Models and Results:<\/p><p>The dataset is divided into training &amp; testing with 157 data points in the test size.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d72a2be elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d72a2be\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-09f3439\" data-id=\"09f3439\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5e502c4 elementor-widget elementor-widget-text-editor\" data-id=\"5e502c4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>We are using confusion matrices to visualize model performance. A confusion matrix represents the True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN).<\/p><p>The confusion matrix structure followed:<\/p><p>1. Support Vector Machine (SVM)<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a0076fc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a0076fc\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1460f28\" data-id=\"1460f28\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a202f28 elementor-widget elementor-widget-text-editor\" data-id=\"a202f28\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Support Vector Machine is a popular algorithm used for regression and classification tasks. We use SVM with a polynomial kernel. We use regularization to improve model accuracy instead of increasing its complexity. We get an accuracy of around 59%. We can find the Confusion matrix and Precision-Recall curve for the SVM model below:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4485bd3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4485bd3\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-69a35ee\" data-id=\"69a35ee\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-fb1ce19 elementor-widget elementor-widget-text-editor\" data-id=\"fb1ce19\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>2. KNN<\/p><p>K-Nearest Neighbors is one of the important supervised algorithms one learns when introduced to the concepts of machine learning. It is a non-parametric model and thus does not depend on the behaviour of the dataset (linear or non-linear). We get an accuracy of around 50%. The Confusion matrix for KNN can be found below:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d5a5732 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d5a5732\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-c2f05ed\" data-id=\"c2f05ed\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-530bc4e elementor-widget elementor-widget-text-editor\" data-id=\"530bc4e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>3. Random Forest<\/p><p>We tried experimenting with ensemble learning algorithms too. We implemented the Random Forest algorithm. The results did not improve as expected. As we can see from the confusion matrix below, the correctly predicted classes (TP + TN) are just a total of 50%. This is not a good model performance.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9e1fc53 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9e1fc53\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f4adca9\" data-id=\"f4adca9\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-bd6e6e1 elementor-widget elementor-widget-text-editor\" data-id=\"bd6e6e1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>4. Deep Learning<\/p><p>We developed a Deep Neural Network using the Keras library. The architecture consists of:<\/p><ul><li>7168 neurons in the input layer<\/li><li>5 hidden layers (20148-512-128-32-4), with ReLU as the activation function and 1 output neuron<\/li><li>We use the Sigmoid activation function in the final layer for binary output<\/li><li>Loss function used &#8211; Binary cross-entropy<\/li><\/ul><p>We get an accuracy of around 54%. We can find the Confusion matrix below<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f59bb98 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f59bb98\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f0193a2\" data-id=\"f0193a2\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-531d6d1 elementor-widget elementor-widget-text-editor\" data-id=\"531d6d1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Fine-Tuning: We chose KNN to improve model performance by fine-tuning using cross-validation techniques. We use K-fold cross-validation with 10 folds. We can see this in the graph below. We achieve the maximum accuracy of around 61%.<\/p><p>Conclusion: The model performances can be seen below:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-385c2a8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"385c2a8\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-131fb8c\" data-id=\"131fb8c\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f07d225 elementor-author-box--align-center elementor-widget elementor-widget-author-box\" data-id=\"f07d225\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"author-box.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-author-box\">\n\t\t\t\n\t\t\t<div class=\"elementor-author-box__text\">\n\t\t\t\t\t\t\t\t\t<div >\n\t\t\t\t\t\t<h4 class=\"elementor-author-box__name\">\n\t\t\t\t\t\t\tSneha Bahl\t\t\t\t\t\t<\/h4>\n\t\t\t\t\t<\/div>\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-author-box__bio\">\n\t\t\t\t\t\t<p>Data Science Intern<\/p>\n\t\t\t\t\t<\/div>\n\t\t\t\t\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>EEG (electroencephalogram) signals are widely used to analyze consumer response in Neuromarketing. When compared with fMRI (Functional Magnetic Resonance Imaging), EEG cannot detect deep responses and exact positions of where the activity occurred but it can track changes in fractions of seconds. The setup is much cheaper and more easily usable than fMRI. We are [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[249],"tags":[95],"class_list":["post-7408","post","type-post","status-publish","format-standard","hentry","category-dataops","tag-cloud"],"_links":{"self":[{"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/posts\/7408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/comments?post=7408"}],"version-history":[{"count":7,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/posts\/7408\/revisions"}],"predecessor-version":[{"id":36050,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/posts\/7408\/revisions\/36050"}],"wp:attachment":[{"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/media?parent=7408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/categories?post=7408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/tags?post=7408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}