{"id":7397,"date":"2021-01-27T13:15:39","date_gmt":"2021-01-27T13:15:39","guid":{"rendered":"http:\/\/ismiletechnologies.com\/?p=7397"},"modified":"2022-12-09T00:43:46","modified_gmt":"2022-12-08T19:13:46","slug":"facial-emotion-recognition-in-neuromarketing","status":"publish","type":"post","link":"https:\/\/ismiletechnologies.com\/en_us\/dataops\/facial-emotion-recognition-in-neuromarketing\/","title":{"rendered":"Facial Emotion Recognition in Neuromarketing"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"7397\" class=\"elementor elementor-7397\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-34077a5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"34077a5\" 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-232d6a7\" data-id=\"232d6a7\" 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-7d42d34 elementor-widget elementor-widget-text-editor\" data-id=\"7d42d34\" 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><span data-contrast=\"none\">Traditional marketing research tools like surveys and focus groups<\/span><span data-contrast=\"none\">\u00a0are\u00a0<\/span><span data-contrast=\"none\">used to evaluate customer response<\/span><span data-contrast=\"none\">s<\/span><span data-contrast=\"none\">\u00a0on various aspects of the product,\u00a0<\/span><span data-contrast=\"none\">but\u00a0<\/span><span data-contrast=\"none\">they\u00a0<\/span><span data-contrast=\"none\">do not fully capture what&#8217;s going on in the customer&#8217;s mind. Responses are not always true in s<\/span><span data-contrast=\"none\">ome<\/span><span data-contrast=\"none\">\u00a0cases. This is where the idea of Neuromarketing\u00a0<\/span><span data-contrast=\"none\">becomes<\/span><span data-contrast=\"none\">\u00a0use<\/span><span data-contrast=\"none\">ful<\/span><span data-contrast=\"none\">. Using non-verbal consumer responses and brain signals\u00a0<\/span><span data-contrast=\"none\">is a<\/span><span data-contrast=\"none\">\u00a0more reliable\u00a0<\/span><span data-contrast=\"none\">method\u00a0<\/span><span data-contrast=\"none\">as they are spontaneous and aren&#8217;t altered by the conscious mind. The widely used methods are &#8211; eye tracking, facial emotion detection, EEG data, and fMRI signals.\u00a0<\/span><span data-ccp-props=\"{\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">In this blog, we&#8217;ll talk about\u00a0<\/span><b><span data-contrast=\"none\">Facial Emotion Detection.<\/span><\/b><span data-ccp-props=\"{\">\u00a0<\/span><\/p><p><b><span data-contrast=\"none\">Facial Emotion Recognition:<\/span><\/b><b> <\/b><span data-contrast=\"none\">Facial expressions and emotions are the most prominent of non-verbal communication. A lot of things that cannot be conveyed by words can easily be expressed using the face.\u00a0<\/span><span data-ccp-props=\"{\">\u00a0<\/span><span data-contrast=\"none\">The most prominent 7 emotions are<\/span><span data-contrast=\"none\">\u00a0&#8211;\u00a0<\/span><span data-contrast=\"none\">ang<\/span><span data-contrast=\"none\">er<\/span><span data-contrast=\"none\">, disgust, fear, happiness, sad<\/span><span data-contrast=\"none\">ness<\/span><span data-contrast=\"none\">, surprise<\/span><span data-contrast=\"none\">d<\/span><span data-contrast=\"none\">, and neutral.\u00a0<\/span><span data-contrast=\"none\">We experimented with 2 of the most famous machine learning models: CNN and SVM.<\/span><span data-ccp-props=\"{\">\u00a0<\/span><\/p><ol><li data-leveltext=\"%1.\" data-font=\"Times New Roman\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><b><span data-contrast=\"none\">CNN<\/span><\/b><span data-ccp-props=\"{\"> : <\/span>Convolutional Neural Networks are known to work well for image analysis tasks. Before building the model, we need to prepare the data for the network.\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <b><span data-contrast=\"none\">Dataset:<\/span><\/b><span data-ccp-props=\"{\"> \u00a0<\/span>The dataset is acquired from Kaggle and consists of the 7 classes (<span data-contrast=\"auto\">0=Angry, 1=Disgust, 2=Fear, 3=Happy, 4=Sad, 5=Surprise, 6=Neutral)\u00a0<\/span><span data-contrast=\"none\">mentioned above. There are 13,690 \u2018350&#215;350\u2019\u00a0<\/span><span data-contrast=\"none\">pixel-colored<\/span><span data-contrast=\"none\"> images of faces exhibiting 7 different expressions.<\/span><\/li><\/ol><p>Distribution of images amongst the classes &#8211;<\/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-a00355c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a00355c\" 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-3b98e8a\" data-id=\"3b98e8a\" 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-acb38aa elementor-widget elementor-widget-text-editor\" data-id=\"acb38aa\" 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><span data-contrast=\"none\">N<\/span><span data-contrast=\"none\">otice that the dataset has\u00a0<\/span><span data-contrast=\"none\">several<\/span><span data-contrast=\"none\">\u00a0more images for the happiness and neutral class<\/span><span data-contrast=\"none\">es<\/span><span data-contrast=\"none\">.\u00a0\u00a0<\/span><span data-ccp-props=\"{\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">Sample image from the dataset &#8211;<\/span><\/p><p><b><span data-contrast=\"none\">Pre-Processing:<\/span><\/b><span data-ccp-props=\"{\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<br \/><\/span><span data-contrast=\"none\">The following pre-processing is performed on the dataset:<\/span><span data-ccp-props=\"{\">\u00a0<\/span><\/p><ol><li data-leveltext=\"%1.\" data-font=\"Times New Roman\" data-listid=\"3\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The facial emotion is independent of the color of the image.\u00a0<\/span><span data-contrast=\"auto\">So,<\/span><span data-contrast=\"auto\"> we can change the image from RGB to grayscale thus reducing the number of channels. This results in an overall reduction in data by a fraction of 3.<\/span><\/li><li data-leveltext=\"%1.\" data-font=\"Times New Roman\" data-listid=\"3\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">The extra background can add noise and misleading information to the input, so extract only the facial part using Cascade Classifier (CV API) and set the image to a fixed size of 48X48 pixels to maintain consistency.<\/span><\/li><\/ol><p><span data-contrast=\"auto\"><span class=\"TextRun BCX0 SCXW20885845\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW20885845\">Our emotion data is categorical. We perform one-hot encoding which converts the labels into vectors containing 0<\/span><\/span><span class=\"TextRun BCX0 SCXW20885845\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW20885845\">\u2019<\/span><\/span><span class=\"TextRun BCX0 SCXW20885845\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW20885845\">s and a 1 in the index position of the class<\/span><\/span><span class=\"TextRun BCX0 SCXW20885845\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW20885845\">.<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop BCX0 SCXW20885845\"><span class=\"BCX0 SCXW20885845\">\u00a0<\/span><br class=\"BCX0 SCXW20885845\" \/><\/span><span class=\"LineBreakBlob BlobObject DragDrop BCX0 SCXW20885845\"><span class=\"BCX0 SCXW20885845\">\u00a0<\/span><br class=\"BCX0 SCXW20885845\" \/><\/span><span class=\"TextRun BCX0 SCXW20885845\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun BCX0 SCXW20885845\">One hot encoding:<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop BCX0 SCXW20885845\"><span class=\"BCX0 SCXW20885845\">\u00a0<\/span><br class=\"BCX0 SCXW20885845\" \/><\/span><\/span><span class=\"TextRun BCX0 SCXW84385143\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXW84385143\">Now, the data is ready to be used to train the model.<\/span><\/span><span class=\"EOP BCX0 SCXW84385143\" data-ccp-props=\"{\">\u00a0<\/span><\/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-b058d0d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b058d0d\" 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-bec6bab\" data-id=\"bec6bab\" 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-729da13 elementor-widget elementor-widget-text-editor\" data-id=\"729da13\" 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><b><span data-contrast=\"none\">Architecture:<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"> \u00a0<\/span><span data-contrast=\"none\">The architecture is built using the\u00a0<\/span><span data-contrast=\"none\">Keras<\/span><span data-contrast=\"none\">\u00a0framework.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p><b><span data-contrast=\"none\">Input:<\/span><\/b><span data-contrast=\"none\">\u00a048&#215;48 grayscale image<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p><b><span data-contrast=\"none\">Output:<\/span><\/b><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">T<\/span><span data-contrast=\"none\">he probability of each expression class<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">The network architecture comprises of:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><ul><li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"3\"><span data-contrast=\"none\">5 convolutional layers<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"3\"><span data-contrast=\"none\">3 sub-sampling layers and\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"3\"><span data-contrast=\"none\">1 fully-connected layer.<\/span><\/li><\/ul><p><b><span data-contrast=\"none\">Layers:<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559731&quot;:360,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><ol><li data-leveltext=\"%1.\" data-font=\"Times New Roman\" data-listid=\"4\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"none\">The first layer of CNN is a convolution layer that applies a convolution kernel of 3<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">\u00d7<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">3 and outputs 64 images of 48 x 48 pixels. This is followed by a sub-sampling layer that uses max-pooling (with kernel size 3 \u00d7<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">3) to reduce the image to the third of its size.\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><\/ol><ol><li data-leveltext=\"%1.\" data-font=\"Times New Roman\" data-listid=\"4\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"none\">The second convolutional layer has an output of 64 images of 16 \u00d716 pixels, followed by a sub-sampling layer with kernel size 2 \u00d7<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">2.\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><\/ol><ol><li data-leveltext=\"%1.\" data-font=\"Times New Roman\" data-listid=\"4\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"none\">The third layer is the same as the second.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><\/ol><ol><li data-leveltext=\"%1.\" data-font=\"Times New Roman\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"none\">The fourth convolutional layer outputs 128 images of size 8 \u00d7<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">8 pixels and uses max pooling with kernel 2 \u00d7<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">2.\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><\/ol><ol><li data-leveltext=\"%1.\" data-font=\"Times New Roman\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"none\">The fifth layer is the same as the fourth.\u00a0\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><\/ol><ol><li data-leveltext=\"%1.\" data-font=\"Times New Roman\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"6\" data-aria-level=\"1\"><span data-contrast=\"none\">The output from the last convolutional layer is given to a fully connected hidden layer. This layer maps 1024 nodes to 7 output nodes (one for each expression that outputs their probability) in a fully connected fashion.\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><\/ol><p><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p><b><span data-contrast=\"none\">Hyper-parameter Tuning:<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">Multiple values for the hyper-parameters were tested and the following gave us the best accuracies:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><ul><li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><b><span data-contrast=\"none\">Optimizer<\/span><\/b><span data-contrast=\"none\">\u00a0\u2013 Adam with a\u00a0<\/span><b><span data-contrast=\"none\">learning rate<\/span><\/b><span data-contrast=\"none\">\u00a0\u2013 1e-3 and a\u00a0<\/span><b><span data-contrast=\"none\">decay<\/span><\/b><span data-contrast=\"none\">\u00a0of 3.125e-5<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><\/ul><ul><li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><b><span data-contrast=\"none\">Batch size\u00a0<\/span><\/b><span data-contrast=\"none\">\u2013 32<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"2\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><b><span data-contrast=\"none\">Loss<\/span><\/b><span data-contrast=\"none\">&#8211; Categorical cross-entropy<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li><\/ul><p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p><b><span data-contrast=\"none\">Results:<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">The ratio of samples in the training set, validation set and test set<\/span><b><span data-contrast=\"none\">\u00a0is 6.8: 2.9: 0.2<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">The CNN model achieved a test accuracy of<\/span><b><span data-contrast=\"none\">\u00a085.15%<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p>\u00a0<\/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-8a065f5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"8a065f5\" 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-a0fda03\" data-id=\"a0fda03\" 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-8eb744c elementor-widget elementor-widget-text-editor\" data-id=\"8eb744c\" 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><span class=\"TextRun BCX0 SCXW131905274\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXW131905274\">2.\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXW131905274\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXW131905274\">SVM<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop BCX0 SCXW131905274\"><span class=\"BCX0 SCXW131905274\">\u00a0<\/span><br class=\"BCX0 SCXW131905274\" \/><\/span><span class=\"LineBreakBlob BlobObject DragDrop BCX0 SCXW131905274\"><span class=\"BCX0 SCXW131905274\">\u00a0<\/span><br class=\"BCX0 SCXW131905274\" \/><\/span><span class=\"TextRun BCX0 SCXW131905274\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXW131905274\">A Support Vector Machine (SVM) finds hyperplanes in high-dimensional space to classify the data points.<\/span><\/span><span class=\"EOP BCX0 SCXW131905274\" data-ccp-props=\"{\">\u00a0<\/span><\/p><p><span class=\"TextRun BCX0 SCXW80064160\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXW80064160\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/span><\/span><span class=\"TextRun BCX0 SCXW80064160\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXW80064160\">Here H3 is the best hyperplane<\/span><\/span><span class=\"EOP BCX0 SCXW80064160\" data-ccp-props=\"{\">\u00a0<\/span><\/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-4eb14c7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4eb14c7\" 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-b7e8028\" data-id=\"b7e8028\" 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-54d945a elementor-widget elementor-widget-text-editor\" data-id=\"54d945a\" 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><b><span data-contrast=\"none\">Dataset:<\/span><\/b><span data-ccp-props=\"{\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">We use another dataset for our SVM model.\u00a0<\/span><span data-contrast=\"none\">There are 1071 images in the dataset which are divided into 803 and 268 images for training and testing dataset. It has 6<\/span><span data-contrast=\"none\">\u00a0classes (<\/span><span data-contrast=\"none\">Anger, Disgust, Happiness, Sadness, Surprise<\/span><span data-contrast=\"none\">d<\/span><span data-contrast=\"none\">, Neutral)<\/span><span data-contrast=\"none\">.<\/span><span data-ccp-props=\"{\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">The previous dataset was\u00a0<\/span><span data-contrast=\"none\">very\u00a0<\/span><span data-contrast=\"none\">skewed which could cause biases in prediction. We chose a much lesser skewed dataset.<\/span><\/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-3554bf8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3554bf8\" 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-c425578\" data-id=\"c425578\" 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-31bc3ce elementor-widget elementor-widget-text-editor\" data-id=\"31bc3ce\" 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><b><span data-contrast=\"none\">Pre-processing:<\/span><\/b><span data-ccp-props=\"{\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">In deciding the facial expression, the points on the eyebrows, eyes, nose, lips, and jawline are of the utmost importance. All these points are extracted and are interpolated from the nose-tip. The distance of these points (green lines) from the nose-tips are used as features for the SVM model.<\/span><\/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-cde4eb0 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"cde4eb0\" 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-91700f3\" data-id=\"91700f3\" 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-35a1d80 elementor-widget elementor-widget-text-editor\" data-id=\"35a1d80\" 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><b><span data-contrast=\"none\">Model architecture<\/span><\/b><span data-ccp-props=\"{\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">The API Scikit-learn is used to implement SVM with C=1 and linear kernel.<\/span><span data-ccp-props=\"{\">\u00a0<\/span><\/p><p><b><span data-contrast=\"none\">Results:<\/span><\/b><span data-ccp-props=\"{\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">The test accuracy was found to be 61.69<\/span><\/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-f43bcf5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f43bcf5\" 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-138809f\" data-id=\"138809f\" 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-0881bcf elementor-widget elementor-widget-text-editor\" data-id=\"0881bcf\" 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><b><span data-contrast=\"none\">Conclusion:<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><p><span data-contrast=\"none\">CNN gives us a better accuracy of 85.15%. It is worth noting that it is also more complex and computationally expansive than the SVM model.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/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-89e23fc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"89e23fc\" 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-84f344b\" data-id=\"84f344b\" 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-80ecfaa elementor-author-box--align-center elementor-widget elementor-widget-author-box\" data-id=\"80ecfaa\" 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 Scientist 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>Traditional marketing research tools like surveys and focus groups\u00a0are\u00a0used to evaluate customer responses\u00a0on various aspects of the product,\u00a0but\u00a0they\u00a0do not fully capture what&#8217;s going on in the customer&#8217;s mind. Responses are not always true in some\u00a0cases. This is where the idea of Neuromarketing\u00a0becomes\u00a0useful. Using non-verbal consumer responses and brain signals\u00a0is a\u00a0more reliable\u00a0method\u00a0as they are spontaneous and [&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-7397","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\/7397","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=7397"}],"version-history":[{"count":4,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/posts\/7397\/revisions"}],"predecessor-version":[{"id":36049,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/posts\/7397\/revisions\/36049"}],"wp:attachment":[{"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/media?parent=7397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/categories?post=7397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ismiletechnologies.com\/en_us\/wp-json\/wp\/v2\/tags?post=7397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}