CINXE.COM

Train An Emotion Recognition Model | DagsHub

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>Train An Emotion Recognition Model | DagsHub</title> <meta name="HandheldFriendly" content="True" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="preload" href="/blog/assets/css/app.css?v=d16ee3eaf3" as="style" /> <link rel="preload" href="/blog/assets/js/manifest.js?v=d16ee3eaf3" as="script" /> <link rel="preload" href="/blog/assets/js/vendor/content-api.min.js?v=d16ee3eaf3" as="script" /> <link rel="preload" href="/blog/assets/js/vendor.js?v=d16ee3eaf3" as="script" /> <link rel="preload" href="/blog/assets/js/app.js?v=d16ee3eaf3" as="script" /> <link rel="preconnect" href="https://polyfill.io"> <link rel="dns-prefetch" href="https://polyfill.io"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700;900&display=swap" rel="stylesheet"> <link rel="preload" href="/blog/assets/css/post.css?v=d16ee3eaf3" as="style" /> <link rel="preload" href="/blog/assets/js/post.js?v=d16ee3eaf3" as="script" /> <style> /* These font-faces are here to make fonts work if the Ghost instance is installed in a subdirectory */ /* source-sans-pro-regular */ @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 400; font-display: swap; src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url("/blog/assets/fonts/source-sans-pro/source-sans-pro-regular.woff2?v=d16ee3eaf3") format('woff2'), url("/blog/assets/fonts/source-sans-pro/source-sans-pro-regular.woff?v=d16ee3eaf3") format('woff'); } /* source-sans-pro-600 */ @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 600; font-display: swap; src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), url("/blog/assets/fonts/source-sans-pro/source-sans-pro-600.woff2?v=d16ee3eaf3") format('woff2'), url("/blog/assets/fonts/source-sans-pro/source-sans-pro-600.woff?v=d16ee3eaf3") format('woff'); } /* source-sans-pro-700 */ @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 700; font-display: swap; src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url("/blog/assets/fonts/source-sans-pro/source-sans-pro-700.woff2?v=d16ee3eaf3") format('woff2'), url("/blog/assets/fonts/source-sans-pro/source-sans-pro-700.woff?v=d16ee3eaf3") format('woff'); } /* iconmoon */ @font-face { font-family: 'icomoon'; font-weight: normal; font-style: normal; font-display: swap; src: url("/blog/assets/fonts/icomoon/icomoon.eot?aoz2mo?v=d16ee3eaf3"); src: url("/blog/assets/fonts/icomoon/icomoon.eot?aoz2mo#iefix?v=d16ee3eaf3") format('embedded-opentype'), url("/blog/assets/fonts/icomoon/icomoon.ttf?aoz2mo?v=d16ee3eaf3") format('truetype'), url("/blog/assets/fonts/icomoon/icomoon.woff?aoz2mo?v=d16ee3eaf3") format('woff'), url("/blog/assets/fonts/icomoon/icomoon.svg?aoz2mo#icomoon?v=d16ee3eaf3") format('svg'); } </style> <script defer src="/blog/assets/fonts/fontawesome/all.min.js?v=d16ee3eaf3"></script> <link rel="stylesheet" type="text/css" href="/blog/assets/fonts/octicons/octicons.min.css?v=d16ee3eaf3"> <link rel="stylesheet" type="text/css" href="/blog/assets/css/app.css?v=d16ee3eaf3" media="screen" /> <link rel="stylesheet" type="text/css" href="/blog/assets/css/post.css?v=d16ee3eaf3" media="screen" /> <meta name="description" content="Learn how to train an emotion recognition model using open source MLOps Tools and the Face Expression Recognition dataset" /> <link rel="icon" href="/blog/favicon.ico" type="image/x-icon" /> <link rel="canonical" href="https://dagshub.com/blog/train-emotion-recognition-model/" /> <meta name="referrer" content="no-referrer-when-downgrade" /> <meta property="og:site_name" content="DagsHub Blog" /> <meta property="og:type" content="article" /> <meta property="og:title" content="Train An Emotion Recognition Model | DagsHub" /> <meta property="og:description" content="Learn how to train an emotion recognition model using open source MLOps Tools and the Face Expression Recognition dataset" /> <meta property="og:url" content="https://dagshub.com/blog/train-emotion-recognition-model/" /> <meta property="og:image" content="https://dagshub.com/blog/content/images/2023/06/priscilla-du-preez-dOnEFhQ7ojs-unsplash.jpg" /> <meta property="article:published_time" content="2023-06-15T07:12:03.000Z" /> <meta property="article:modified_time" content="2023-12-19T15:41:03.000Z" /> <meta property="article:tag" content="Computer Vision" /> <meta property="article:tag" content="Data Streaming" /> <meta property="article:tag" content="MLOps" /> <meta property="article:tag" content="Data Version Control" /> <meta property="article:tag" content="Direct Data Access" /> <meta property="article:tag" content="Open Source Datasets" /> <meta property="article:tag" content="Data Management" /> <meta property="article:publisher" content="https://www.facebook.com/dagshub" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:title" content="Train An Emotion Recognition Model | DagsHub" /> <meta name="twitter:description" content="Learn how to train an emotion recognition model using open source MLOps Tools and the Face Expression Recognition dataset" /> <meta name="twitter:url" content="https://dagshub.com/blog/train-emotion-recognition-model/" /> <meta name="twitter:image" content="https://dagshub.com/blog/content/images/2023/06/priscilla-du-preez-dOnEFhQ7ojs-unsplash.jpg" /> <meta name="twitter:label1" content="Written by" /> <meta name="twitter:data1" content="Gaurav Mohan" /> <meta name="twitter:label2" content="Filed under" /> <meta name="twitter:data2" content="Computer Vision, Data Streaming, MLOps, Data Version Control, Direct Data Access, Open Source Datasets, Data Management" /> <meta name="twitter:site" content="@TheRealDAGsHub" /> <meta property="og:image:width" content="2000" /> <meta property="og:image:height" content="1333" /> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "publisher": { "@type": "Organization", "name": "DagsHub Blog", "url": "https://dagshub.com/blog/", "logo": { "@type": "ImageObject", "url": "https://dagshub.com/blog/content/images/2023/12/Dagshub-favicon.svg" } }, "author": { "@type": "Person", "name": "Gaurav Mohan", "image": { "@type": "ImageObject", "url": "https://dagshub.com/blog/content/images/2023/06/profile.JPG", "width": 1440, "height": 1800 }, "url": "https://dagshub.com/blog/author/gaurav/", "sameAs": [ "https://gauravamohan.medium.com/" ] }, "headline": "Train An Emotion Recognition Model | DagsHub", "url": "https://dagshub.com/blog/train-emotion-recognition-model/", "datePublished": "2023-06-15T07:12:03.000Z", "dateModified": "2023-12-19T15:41:03.000Z", "image": { "@type": "ImageObject", "url": "https://dagshub.com/blog/content/images/2023/06/priscilla-du-preez-dOnEFhQ7ojs-unsplash.jpg", "width": 2000, "height": 1333 }, "keywords": "Computer Vision, Data Streaming, MLOps, Data Version Control, Direct Data Access, Open Source Datasets, Data Management", "description": "Learn how to train an emotion recognition model using open source MLOps Tools and the Face Expression Recognition dataset", "mainEntityOfPage": { "@type": "WebPage", "@id": "https://dagshub.com/blog/" } } </script> <meta name="generator" content="Ghost 3.42" /> <link rel="alternate" type="application/rss+xml" title="DagsHub Blog" href="https://dagshub.com/blog/rss/" /> <script> const ghostSearchApiKey = '44bb83122f80c74bc070982817' </script> <!-- prism.js syntax highlighting --> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/themes/prism.min.css" /> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/themes/prism-tomorrow.min.css" /> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-PGHTMDN');</script> <!-- End Google Tag Manager --> <style> pre[class*="language-"] { margin: 0 0 1.5em !important; } code { text-shadow: none !important; } .token.operator { background: none !important; } :not(pre) > code[class*="language-"], pre[class*="language-"] { background: #20262E !important; } html { --aside-background-color: #f1f1ef; } html[data-theme='dark'] { --aside-background-color: #103037; } aside { padding: 1em; margin-bottom: 30px; font-size: 1.25em; line-height: 1.6em; background-color: var(--aside-background-color); border-radius: 10px; display: flex; } aside div.aside-emoji { display: block; } aside div.aside-text { display: flex; flex-direction: column; margin-left: 8px; } pre[class*=language-] { border-radius: 10px; } </style> <script> // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat const ghostHost = "https://dagshub.com/blog" // @license-end </script> </head> <body class="post-template tag-computer-vision tag-data-streaming tag-mlops tag-data-version-control tag-direct-data-access tag-open-source-datasets tag-data-management"> <header class="site-head site-head__bacground" role="banner" itemscope="itemscope" itemtype="http://schema.org/WPHeader"> <div class="site-head__wrap"> <div class="container container-lg"> <div class="site-head__frame"> <!-- Custom logo and site title. --> <div class="site-logo"> <a href="https://dagshub.com/" class="custom-logo-link" rel="home" aria-current="page"><img width="143" height="40" src="https://dagshub.com/wp-content/uploads/2024/04/dagshab.svg" class="custom-logo" alt="DagsHub" decoding="async"></a> <span class="screen-reader-text" itemprop="name">DagsHub</span> </div> <button class="nav-opener" aria-label="nav opener" onClick="this.parentNode.parentNode.parentNode.parentNode.classList.toggle('nav-active')"><span><em>Menu</em></span></button> <div class="site-head__holder"> <!-- Main menu. --> <nav class="site-head__nav js-header-menu-item" role="navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> <ul class="menu head-nav main-header-menu"><li id="menu-item-2351" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-2351" aria-haspopup="true"> <div class="menu-item__link menu-item__link--title">Resources</div> <button class="dropdown-toggle" aria-expanded="false" onClick="this.classList.toggle('toggled-on');this.parentNode.classList.toggle('submenu-open')"><span class="screen-readers">Expand child menu</span><span class="opener-arrow"><svg class="svg-icon icon-chevron-down" width="20" height="20"><use xlink:href='/blog/assets/images/icons.svg?v=d16ee3eaf3#icon-chevron-down'></use></svg></span></button> <ul class="sub-menu level0"> <li id="menu-item-2357" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2357"> <a href="https://dagshub.com/blog/" class="menu-item__link"><span class="menu-item__text">Blog</span></a> </li> <li id="menu-item-2358" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2358"> <a href="https://dagshub.com/datasets/" class="menu-item__link"><span class="menu-item__text">Datasets</span></a> </li> <li id="menu-item-2359" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2359"> <a href="https://dagshub.com/glossary/" class="menu-item__link"><span class="menu-item__text">Glossary</span></a> </li> <li id="menu-item-2360" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2360"> <a href="https://dagshub.com/blog/tag/tutorials/" class="menu-item__link"><span class="menu-item__text">Tutorial &amp; Webinars</span></a> </li> </ul> </li> <li id="menu-item-2352" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2352"> <a href="https://dagshub.com/docs" class="menu-item__link"><span class="menu-item__text">Docs</span></a> </li> <li id="menu-item-2353" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-2353" aria-haspopup="true"> <div class="menu-item__link menu-item__link--title">Product</div> <button class="dropdown-toggle" aria-expanded="false" onClick="this.classList.toggle('toggled-on');this.parentNode.classList.toggle('submenu-open')"><span class="screen-readers">Expand child menu</span><span class="opener-arrow"><svg class="svg-icon icon-chevron-down" width="20" height="20"><use xlink:href='/blog/assets/images/icons.svg?v=d16ee3eaf3#icon-chevron-down'></use></svg></span></button> <ul class="sub-menu level0"> <li id="menu-item-2361" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2361"> <a href="https://dagshub.com/data-engine/" class="menu-item__link"><span class="menu-item__text"><span class="icon-image"><svg class="svg-icon icon-data-engine" width="20" height="20"><use xlink:href='/blog/assets/images/icons.svg?v=d16ee3eaf3#icon-data-engine'></use></svg></span><span class="menu-text-wrapper"><span class="menu-text">Data engine</span><span class="menu-description">Manage your unstructured data</span></span></span></a> </li> <li id="menu-item-2362" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2362"> <a href="https://dagshub.com/use-cases/llm/" class="menu-item__link"><span class="menu-item__text"><span class="icon-image"><svg class="svg-icon icon-llms" width="20" height="20"><use xlink:href='/blog/assets/images/icons.svg?v=d16ee3eaf3#icon-llms'></use></svg></span><span class="menu-text-wrapper"><span class="menu-text">LLMs</span><span class="menu-description">Build LLM projects quickly</span></span></span></a> </li> <li id="menu-item-2363" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2363"> <a href="https://dagshub.com/product/" class="menu-item__link"><span class="menu-item__text"><span class="icon-image"><svg class="svg-icon icon-linear-search" width="20" height="20"><use xlink:href='/blog/assets/images/icons.svg?v=d16ee3eaf3#icon-linear-search'></use></svg></span><span class="menu-text-wrapper"><span class="menu-text">Overview</span><span class="menu-description">Organize your entire project under one roof</span></span></span></a> </li> <li id="menu-item-2364" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2364"> <a href="https://dagshub.com/enterprise/" class="menu-item__link"><span class="menu-item__text"><span class="icon-image"><svg class="svg-icon icon-enterprise" width="20" height="20"><use xlink:href='/blog/assets/images/icons.svg?v=d16ee3eaf3#icon-enterprise'></use></svg></span><span class="menu-text-wrapper"><span class="menu-text">Enterprise</span><span class="menu-description">A single source of truth for your organization</span></span></span></a> </li> </ul> </li> <li id="menu-item-2354" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2354"> <a href="/enterprise/" class="menu-item__link"><span class="menu-item__text">Enterprise</span></a> </li> <li id="menu-item-2355" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2355"> <a href="https://dagshub.com/pricing" class="menu-item__link"><span class="menu-item__text">Pricing</span></a> </li> <li id="menu-item-2356" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-2356" aria-haspopup="true"> <div class="menu-item__link menu-item__link--title">Company</div> <button class="dropdown-toggle" aria-expanded="false" onClick="this.classList.toggle('toggled-on');this.parentNode.classList.toggle('submenu-open')"><span class="screen-readers">Expand child menu</span><span class="opener-arrow"><svg class="svg-icon icon-chevron-down" width="20" height="20"><use xlink:href='/blog/assets/images/icons.svg?v=d16ee3eaf3#icon-chevron-down'></use></svg></span></button> <ul class="sub-menu level0"> <li id="menu-item-2365" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2365"> <a href="https://dagshub.com/about" class="menu-item__link"><span class="menu-item__text">About</span></a> </li> <li id="menu-item-2366" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2366"> <a href="https://dagshub.com/careers" class="menu-item__link"><span class="menu-item__text">Careers</span></a> </li> <li id="menu-item-2367" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2367"> <a href="https://dagshub.com/contact-us/" class="menu-item__link"><span class="menu-item__text">Contact us</span></a> </li> </ul> </li> </ul> </nav> <div class="site-head__tools"> <ul class="menu head-nav main-header-menu"><li id="menu-item-2372" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2372"><a rel="Navbar_Login_Clicked" href="https://dagshub.com/user/login" class="menu-item__link" data-analytics-event="Navbar_Login_Clicked">Log in</a></li> <li id="menu-item-2389" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2389"><a rel="Navbar_BookADemo_Clicked" href="https://dagshub.com/book-a-demo/" class="menu-item__button btn btn--white-outline" data-analytics-event="Navbar_BookADemo_Clicked"><span class="btn__text">Book a demo</span></a></li> <li id="menu-item-2370" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2370"><a rel="Navbar_StartFree_Clicked" href="https://dagshub.com/user/sign_up" class="menu-item__button btn btn--primary" data-analytics-event="Navbar_StartFree_Clicked"><span class="btn__text">Start Free</span></a></li> </ul> </div> </div> </div> </div> </div> </header> <main class="main-wrap"> <article> <div class="l-content in-post"> <div class="l-wrapper in-post js-aos-wrapper" data-aos="fade-up" data-aos-delay="300"> <div class="l-post-content js-progress-content"> <header class="m-heading"> <h1 class="m-heading__title in-post">Train An Emotion Recognition Model Using Open Source MLOps Tools</h1> <ul class="details"> <li> <div style="background-image: url(/blog/content/images/size/w100/2023/06/profile.JPG);"></div> <a href="https://dagshub.com/blog/author/gaurav/">Gaurav Mohan</a> </li> <li>11 min read</li> <li>a year ago</li> </ul> <p class="bio">I am a Data Science professional and enjoy exploring and blogging about new AI/ML mechanisms through applied use cases. </p> <img src="https://dagshub.com/blog/content/images/2023/06/priscilla-du-preez-dOnEFhQ7ojs-unsplash.jpg" alt="" class="featured" /> </header> <div class="p-container"> <div class="p-sidebar"> <strong>About DagsHub</strong> <a> <img src="/blog/assets/images/video-placeholder.png?v=d16ee3eaf3" alt="" /> <svg class="svg-icon icon-play-color" width="100" height="100" "=""><use xlink:href="../assets/images/play-icon.svg#icon-play-color"></use></svg> </a> <p>DagsHub simplifies the process of building better models and managing unstructured data projects by consolidating data, code, experiments, and models in one place.</p> <hr /> <strong>Table of Contents</strong> <ul></ul> <b>Share This Article</b> <a href="https://www.facebook.com/sharer/sharer.php?u=https://dagshub.com/blog/train-emotion-recognition-model/" onclick="window.open(this.href, 'pop', 'width=500,height=570');return false;" class="m-icon-button filled in-share" target="_blank" rel="noopener" aria-label="Share on Facebook"> <span class="icon-facebook" aria-hidden="true"></span> </a> <a href="https://www.linkedin.com/shareArticle?mini=true&url=https://dagshub.com/blog/train-emotion-recognition-model/" onclick="window.open(this.href, 'share-linkedin', 'width=500,height=570');return false;" class="m-icon-button filled in-share" target="_blank" rel="noopener" aria-label="Share on LinkedIn"> <span class="icon-linkedin" aria-hidden="true"></span> </a> <a href="https://twitter.com/intent/tweet?text=Train%20An%20Emotion%20Recognition%20Model%20Using%20Open%20Source%20MLOps%20Tools&url=https://dagshub.com/blog/train-emotion-recognition-model/" onclick="window.open(this.href, 'share-twitter', 'width=500,height=605');return false;" class="m-icon-button filled in-share" target="_blank" rel="noopener" aria-label="Share on Twitter"> <span class="icon-twitter" aria-hidden="true"></span> </a> </div> <div class="p-content"> <h3 id="introduction">Introduction</h3><p>This tutorial takes you on a journey to construct an emotion recognition model using the renowned VGG model and the comprehensive FER dataset. We delve into the fundamental principles of emotion recognition, explore the rationale behind VGG, and dive into the <a href="https://www.kaggle.com/datasets/ashishpatel26/facial-expression-recognitionferchallenge">FER</a> dataset. We then go over all the project components and processes, from data preparation, model training, and experiment tracking to model evaluation, to equip you with the skills to construct your own emotion recognition model.</p><p>Refer to this <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/src/second">repository</a> as we walk through the project.</p><h3 id="project-overview">Project Overview</h3><p>For this project, we’re going to be utilizing a <a href="https://keras.io/api/applications/vgg/">VGG19</a> model pre-trained on ImageNet. VGG models have achieved strong performance on the ImageNet benchmark, which indicates their ability to generalize well to different visual recognition tasks. It is very accurate in image recognition and has a deep network and with small 3x3 convolutional filters. While other models like ResNet allow for even deeper networks and performs inference faster, VGG generalizes better which is important in facial recognition tasks.</p><p>Let’s take a moment to break down the project architecture shown above before we dive into the code.</p><h3 id="what-is-the-fer-dataset">What is the FER dataset?</h3><p>FER, Facial Expression Recognition, is an open-source dataset released in 2013. It was introduced in a paper titled "Challenges in Representation Learning: A Report on Three Machine Learning Contests" by Pierre-Luc Carrier and Aaron Courville. It holds cropped facial images of size 48x48 pixels, represented in a flattened array of 2304 pixels.</p><figure class="kg-card kg-image-card"><img src="https://dagshub.com/blog/content/images/2023/06/image.png" class="kg-image" alt srcset="https://dagshub.com/blog/content/images/size/w600/2023/06/image.png 600w, https://dagshub.com/blog/content/images/size/w1000/2023/06/image.png 1000w, https://dagshub.com/blog/content/images/2023/06/image.png 1214w" sizes="(min-width: 720px) 720px"></figure><p>Each image is labeled with a representative emotion using the following mapping:  {0:'anger', 1:'disgust', 2:'fear', 3:'happiness', 4: 'sadness', 5: 'surprise', 6: 'neutral'}</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://dagshub.com/blog/content/images/2023/06/image-1.png" class="kg-image" alt srcset="https://dagshub.com/blog/content/images/size/w600/2023/06/image-1.png 600w, https://dagshub.com/blog/content/images/size/w1000/2023/06/image-1.png 1000w, https://dagshub.com/blog/content/images/2023/06/image-1.png 1600w" sizes="(min-width: 720px) 720px"><figcaption>Visual generated from DVC-managed dataset in DagsHub Repository</figcaption></figure><h3 id="data-pipeline-overviews">Data pipeline overviews</h3><p>The pipeline in this project is managed by DVC and has three stages:</p><ul><li><strong>Process data:</strong>  extracts the image features, encodes the labels, splits the dataset to train, and test, and saves them to file.</li><li><strong>Model:</strong> utilizes the training data to train a model and tune the hyper-parameters.</li><li><strong>Analyze:</strong> evaluates the model’s performance using the validation data.</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://dagshub.com/blog/content/images/2023/06/image-2.png" class="kg-image" alt srcset="https://dagshub.com/blog/content/images/size/w600/2023/06/image-2.png 600w, https://dagshub.com/blog/content/images/size/w1000/2023/06/image-2.png 1000w, https://dagshub.com/blog/content/images/2023/06/image-2.png 1592w" sizes="(min-width: 720px) 720px"><figcaption>DVC Pipeline Architecture</figcaption></figure><p>The full pipeline is shown <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/src/main/dvc.yaml">here</a>.</p><h3 id="data-processing">Data Processing</h3><p>The <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/src/second/code/preprocess.py">preprocess</a> script covers all the necessary steps to get our data ready for training. It has five main steps:</p><ol><li>Converted the string pixels into (48, 48, 3) image arrays.</li><li>Encoded the labels</li><li>Split the data into train and validation using stratified split</li><li>Saved the train/validation as numpy data files</li><li>Pushed the data files to our remote DagsHub repository</li></ol><p>The data is first reshaped into a 48x48 numpy 2D array in order to make it compatible with the VGG model. The arrays are then iteratively converted from grayscale to RGB. By converting grayscale images to RGB, we make it compatible with the pre-trained VGG model and effectively replicate the grayscale intensity values across all three channels, allowing the model to benefit from color-based features during training. The corresponding labels are then encoded using the following code:</p><pre><code class="language-python">from keras.utils import to_categorical labels = df['emotion'].values encoded_labels = to_categorical(labels, num_classes=7) </code></pre><p>Finally, the data is split into a train and validation set using a stratified split.</p><h3 id="model-development">Model Development</h3><p>Now that we have our training and validation data, it is time to build the model, train it, and run experiments to improve performance using the <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/src/second/code/model.py">model</a> script. The following image shows a standard VGG19 model and one shown after re-orchestrating the last block of the model.</p><p>Something cool I discovered on DagsHub is that it visualizes the model’s architecture using Nitron! You can check it out <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/src/main/data/model.h5">here</a>.</p><figure class="kg-card kg-image-card"><img src="https://dagshub.com/blog/content/images/2023/06/Screenshot-2023-06-14-at-5.38.31-PM.png" class="kg-image" alt srcset="https://dagshub.com/blog/content/images/size/w600/2023/06/Screenshot-2023-06-14-at-5.38.31-PM.png 600w, https://dagshub.com/blog/content/images/size/w1000/2023/06/Screenshot-2023-06-14-at-5.38.31-PM.png 1000w, https://dagshub.com/blog/content/images/2023/06/Screenshot-2023-06-14-at-5.38.31-PM.png 1044w" sizes="(min-width: 720px) 720px"></figure><p>In order to preserve the weights of the model prior to training on a new dataset, we replace the last convolution block with the output layer for the FER dataset, replace the MaxPooling2D with a GlobalAveragePooling2D, and add a final dense layer for the model output.</p><pre><code class="language-python">base_model = tf.keras.applications.VGG19(weights='imagenet', include_top=False, input_shape=(48, 48, 3)) # Add dense layers x = base_model.layers[-2].output x = GlobalAveragePooling2D()(x) # Add final classification layer output_layer = Dense(num_classes, activation='softmax')(x) # Create model model = Model(inputs=base_model.input, outputs=output_layer) </code></pre><p>A GlobalAveragePooling2D layer reduces the computation time by computing the average of each feature map, which forces the network to learn features that are globally relevant to the task resulting in a one-dimensional vector with a smaller number of values. While this is the general architecture of the model, it isn’t ready for deployment.</p><h3 id="data-augmentation">Data Augmentation</h3><p>In terms of data augmentation, in the prior stage, I stored the counts of each class label within the dataset. As you can see this is an imbalanced dataset; there are much more data points for happiness, neutrality, and sadness compared to disgust and surprise.</p><pre><code class="language-python">{"3": 8989, "6": 6198, "4": 6077, "2": 5121, "0": 4953, "5": 4002, "1": 547} emotion labels → {0:'anger', 1:'disgust', 2:'fear', 3:'happiness', 4: 'sadness', 5: 'surprise', 6: 'neutral'} </code></pre><p>There are two ways we can handle the imbalanced dataset. The first way is to actually generate more data using ImageDataGenerator. This is commonly used in deep learning tasks to generate more training samples through random rotations, translations, shearing, zooming, flipping, and other image modifiers. Applying this technique will help the model generalize better and improve the accuracy on the test set given that this model is skewed to certain labels. The implementation is shown below. The data generator is fitted on the training set and incorporated into the model as it is training.</p><pre><code class="language-python">train_datagen = ImageDataGenerator(rotation_range=20, width_shift_range=0.20, height_shift_range=0.20, shear_range=0.15, zoom_range=0.15, horizontal_flip=True, fill_mode='nearest') train_datagen.fit(X_train) </code></pre><p>The second method to handle an imbalanced dataset is to pass in the class weights while the model is training. The resulting weights can be used to balance the loss function during training. Class weights are automatically adjusted to the frequencies of the input data as: <code>n_samples / (n_classes * np.bincount(y))</code></p><pre><code class="language-python">class_weights = compute_class_weight( class_weight = "balanced", classes = np.unique(y_train.argmax(axis=1)), y = y_train.argmax(axis=1) ) class_weights_dict = dict(enumerate(class_weights)) ## Now train the model history = model.fit(train_datagen.flow(X_train, y_train, batch_size = batch_size), validation_data = (X_valid, y_valid), steps_per_epoch = steps_per_epoch, epochs = epochs, callbacks = callbacks, use_multiprocessing = True, class_weight=class_weights_dict) </code></pre><p>The <code>class_weights_dict</code> is passed along with the <em>train_datagen</em> to generate random batches of data and balance the loss function.</p><p>The callbacks, early stopping and learning rate scheduler, also handle overfitting by reducing the learning rate if the loss doesn’t reduce over the epochs or stopping the training completely.</p><pre><code class="language-python">lr_scheduler = ReduceLROnPlateau(monitor = 'val_accuracy', factor = 0.25, patience = 8, min_lr = 1e-6, verbose = 1) early_stopping = EarlyStopping(monitor = 'val_accuracy', min_delta = 0.00005, patience = 12, verbose = 1, restore_best_weights = True) </code></pre><p>The patience parameter states how many epochs of continuous performance decline need to occur before the callback is applied to the training process.</p><p>We can <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/experiments/#/compare?experiments=%5B%22m_233e9f4b0f7b4656b9bbdb9d483ec180%22,%22m_2bfffd3339154d289be50533c828bf10%22%5D">compare two experiments</a> run with matching parameters. The only change between the models is that the class weights are incorporated during the training. As you can see the model performs slightly better with this addition. The <code>train_loss</code> is significantly reduced and the validation accuracy also improves slightly.</p><figure class="kg-card kg-image-card"><img src="https://dagshub.com/blog/content/images/2023/06/image-5.png" class="kg-image" alt srcset="https://dagshub.com/blog/content/images/size/w600/2023/06/image-5.png 600w, https://dagshub.com/blog/content/images/size/w1000/2023/06/image-5.png 1000w, https://dagshub.com/blog/content/images/size/w1600/2023/06/image-5.png 1600w, https://dagshub.com/blog/content/images/2023/06/image-5.png 1992w" sizes="(min-width: 720px) 720px"></figure><h3 id="hyper-parameter-search">Hyper Parameter Search</h3><p>The next step in tuning the model is to find the best-fitting hyper parameters. One way to accomplish this is to use a Keras tuner. The Keras tuner is a built-in module that can be applied to Keras models by searching for a specific set of hyper parameters that are provided.</p><p>I created two different experiments. The first one is focused on testing different sets of optimizers, learning rates, batch sizes, and epochs. We will use the <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/src/second/code/tune_model.ipynb">tune_model.ipynb</a> to run these experiments.</p><p>The parameters are passed as hp objects. They are given a min and max value and a step value to provide a range of values that can be tested. In the first iteration of search, we want to test different combinations of batch size, epochs, and learning rate.</p><pre><code class="language-python">from kerastuner.engine.hyperparameters import HyperParameters from kerastuner.tuners import RandomSearch hp = HyperParameters() batch_size = hp.Int('batch_size', min_value=16, max_value=256, step=16) epochs = hp.Int('epochs', min_value=10, max_value=50, step=10) </code></pre><p>The hp objects are passed into the build model function and a different set of values are tested on each trial. The number of trials is set as max trials. Depending on the number of hyper parameters, the step size, and overall range, it may make sense to increase or decrease the number of trials so that the tuner is able to effectively search enough combinations of these parameters. The goal is to maximize the validation accuracy as shown below.</p><pre><code class="language-python"> tuner = RandomSearch(build_model, objective='val_accuracy', max_trials=10, hyperparameters=hp) tuner.search(train_datagen.flow(X_train, y_train, batch_size=batch_size), validation_data=(X_valid, y_valid), epochs=epochs, callbacks=[early_stopping, lr_scheduler, mlflow_callback], use_multiprocessing=True) </code></pre><h3 id="mlflow-callback">MLFlow Callback</h3><p>One callback that is shown that we have not discussed yet is the <code>mlflow_callback</code>. The callback tracks the changes in model accuracy at the end of each epoch and logs it to DagsHub as an experiment. In order to incorporate it within the keras tuner, I created an <a href="https://dagshub.com/glossary/mlflow/">MLflow</a> class to track the change in validation accuracy after each epoch in a trial.</p><pre><code class="language-bash">class MlflowCallback(Callback): def __init__(self, run_name): self.run_name = run_name def on_train_begin(self, logs=None): mlflow.set_tracking_uri("&lt;https://dagshub.com/GauravMohan1/Emotion-Classification.mlflow&gt;") mlflow.start_run(run_name=self.run_name) def on_trial_end(self, trial, logs={}): hp = trial.hyperparameters.values for key, value in hp.items(): mlflow.log_param(key, value) mlflow.log_param('epochs', 32) mlflow.log_param('batch_size', 212) mlflow.log_param('learning_rate', 0.003) mlflow.log_metric("val_accuracy", logs["val_accuracy"]) mlflow.log_metric("train_accuracy", logs["train_accuracy"]) mlflow.log_metric("val_loss", logs["val_loss"]) mlflow.log_metric("train_loss", logs["val_loss"]) def on_train_end(self, logs=None): mlflow.end_run() mlflow_callback = MlflowCallback('layers add') </code></pre><p>The mlflow callback sets the tracking uri at the start when the keras tuner starts its search. You will need to configure <a href="https://dagshub.com/docs/integration_guide/mlflow_tracking/">mlflow</a> with your own credentials. You must export the tracking username and password as environment variables in your project shell prior to setting the tracking uri as shown below.</p><pre><code class="language-bash">export MLFLOW_TRACKING_USERNAME=&lt;your username&gt; export MLFLOW_TRACKING_PASSWORD=&lt;your password/token&gt; </code></pre><p>When the trial is completed the metrics and hyper parameters that are logged will be stored within the experiments tab in the DagsHub repository. A plot is also generated to show the following change in accuracy over each epoch.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://dagshub.com/blog/content/images/2023/06/image-6.png" class="kg-image" alt srcset="https://dagshub.com/blog/content/images/size/w600/2023/06/image-6.png 600w, https://dagshub.com/blog/content/images/2023/06/image-6.png 628w"><figcaption>Sample Trial Results from Tracking Validation Accuracy over Epochs</figcaption></figure><p>I found that the SGD optimizer worked the best along with a low learning rate, large batch size, and an epoch range from 30 to 40. Here is the <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/experiments/#/experiment/m_c2769d79a37c4389bf918e36d9cb5726">experiment</a> that yielded the best results for these set of parameters..</p><p>The next set of parameters searched is additional dense layers, the number of units within these layers, and the regularization penalty. The best parameters from the first search is passed into these next trials.</p><pre><code class="language-python"># Define the hyperparameter search space # Now I want to test if adding additional layers and adding regularization will help improve overfitting or improve accuracy hp = HyperParameters() num_dense_layers = hp.Int('num_dense_layers', min_value=1, max_value=3) num_units = hp.Int('num_units', min_value=64, max_value=512, step=32) reg_strength = hp.Float('reg_strength', min_value=0.001, max_value= 0.1, step=0.004) tuner.search(train_datagen.flow(X_train, y_train, batch_size=212), validation_data=(X_valid, y_valid), epochs = 32, steps_per_epoch = len(X_train) / 212, callbacks=[early_stopping, lr_scheduler, mlflow_callback], use_multiprocessing=True) best_hp = tuner.get_best_hyperparameters()[0] mlflow.log(best_hp.values) </code></pre><p>The reason we add additional layers and apply regularization is to see if a higher learning rate and epoch count can be effective. The downside of doing this is that it can cause overfitting which did occur in some experiments. However, adding additional dense layers along with L2 regularization can mitigate the overfitting.</p><p>The model did not seem to respond well to added layers and plateaued in accuracy over the course of training.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://dagshub.com/blog/content/images/2023/06/image-7.png" class="kg-image" alt srcset="https://dagshub.com/blog/content/images/size/w600/2023/06/image-7.png 600w, https://dagshub.com/blog/content/images/2023/06/image-7.png 700w"><figcaption>Sample Trial Results from tracking validation accuracy over epochs</figcaption></figure><h3 id="experiment-tracking">Experiment Tracking</h3><p>Once you have found a set of parameters that perform well, you no longer need to use the keras tuner. We can once again train the model and log the parameters using MLFlow. After setting the tracking uri and starting the run, we will build and train the model as shown before. Now we can define all the parameters and log the results at the end of the run.</p><pre><code class="language-python">mlflow.set_tracking_uri("&lt;https://dagshub.com/GauravMohan1/Emotion-Classification.mlflow&gt;") with mlflow.start_run(): # batch size of 32 performs the best. model = build_model(num_classes) history = train(model, X_train, y_train, X_valid, y_valid) metrics = {"train_accuracy": history.history['accuracy'][-1], "val_accuracy": history.history['val_accuracy'][-1], "train_loss": history.history['loss'][-1], "val_loss": history.history['val_loss'][-1]} params = {"optimizer": {'type': 'sgd', 'learning_rate': 0.0092, 'momentum': 0.90, 'nesterov': True}, "loss": 'categorical_crossentropy', 'batch_size': 96, 'epochs': 24, 'callbacks': ['EarlyStopping', 'ReduceLROnPlateau'], 'data_augmentation': 'ImageDataGenerator'} mlflow.log_metrics(metrics) mlflow.log_params(params) </code></pre><h3 id="model-evaluation">Model Evaluation</h3><p>After running multiple experiments, I compared the top 3 performing ones. I wanted to choose a model that maximizes validation accuracy while minimizing the loss. I also compared the training accuracy and loss to make sure the model wasn’t overfitting too much. The second model performs the best. I saved this <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/src/main/data/model.h5">model</a> in my repository.</p><figure class="kg-card kg-image-card"><img src="https://dagshub.com/blog/content/images/2023/06/image-8.png" class="kg-image" alt srcset="https://dagshub.com/blog/content/images/size/w600/2023/06/image-8.png 600w, https://dagshub.com/blog/content/images/size/w1000/2023/06/image-8.png 1000w, https://dagshub.com/blog/content/images/size/w1600/2023/06/image-8.png 1600w, https://dagshub.com/blog/content/images/2023/06/image-8.png 2004w" sizes="(min-width: 720px) 720px"></figure><p>The last step in the model process is to evaluate the performance of the model. We utilize <a href="https://papermill.readthedocs.io/en/latest/">papermill</a> to execute the <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/src/main/code/evaluate_out.ipynb">evaluation notebook</a> in a separate <a href="https://dagshub.com/GauravMohan1/Emotion-Classification/src/second/code/eval.py">eval</a> script so it can be handled by the DVC pipeline.</p><p>Let’s look at the results of the model’s performance on the validation dataset.</p><figure class="kg-card kg-image-card"><img src="https://dagshub.com/blog/content/images/2023/06/image-9.png" class="kg-image" alt srcset="https://dagshub.com/blog/content/images/size/w600/2023/06/image-9.png 600w, https://dagshub.com/blog/content/images/size/w1000/2023/06/image-9.png 1000w, https://dagshub.com/blog/content/images/2023/06/image-9.png 1048w" sizes="(min-width: 720px) 720px"></figure><!--kg-card-begin: html--><table> <thead> <tr> <th></th> <th>precision</th> <th>recall</th> <th>f1-score</th> <th>support</th> </tr> </thead> <tbody> <tr> <td>anger</td> <td>0.56</td> <td>0.64</td> <td>0.60</td> <td>743</td> </tr> <tr> <td>disgust</td> <td>0.58</td> <td>0.49</td> <td>0.53</td> <td>82</td> </tr> <tr> <td>fear</td> <td>0.54</td> <td>0.44</td> <td>0.49</td> <td>768</td> </tr> <tr> <td>happiness</td> <td>0.89</td> <td>0.87</td> <td>0.88</td> <td>1349</td> </tr> <tr> <td>sadness</td> <td>0.58</td> <td>0.57</td> <td>0.57</td> <td>912</td> </tr> <tr> <td>surprise</td> <td>0.67</td> <td>0.81</td> <td>0.74</td> <td>600</td> </tr> <tr> <td>neutral</td> <td>0.65</td> <td>0.62</td> <td>0.63</td> <td>930</td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>accuracy</td> <td></td> <td></td> <td>0.67</td> <td>5384</td> </tr> <tr> <td>macro avg</td> <td>0.64</td> <td>0.63</td> <td>0.63</td> <td>5384</td> </tr> <tr> <td>weighted avg</td> <td>0.67</td> <td>0.67</td> <td>0.67</td> <td>5384</td> </tr> </tbody> </table><!--kg-card-end: html--><p>Total Wrong Validation Predictions: 1773</p><h3 id="insights-and-conclusions">Insights and Conclusions</h3><p>Given that we are using an imbalanced data set, the model is struggling to accurately predict the disgust, fear, and sadness labels due to the lack of samples provided in the test. The lack of training samples for specific class labels is a major problem in many multi-class classifiers. In addition, the model is overfitting even with the callbacks and regularization added. This may be because we are using every trainable parameter in the VGG model to tune to the dataset, instead of potentially freezing some layers. Due to the complexity and number of parameters in the model it may struggle to generalize to new data.</p><p>It may be useful to train this model on different datasets to improve its ability to generalize against new data, reduce bias on certain class labels, and improve the overall performance of the model.</p><p>We can accomplish this by hosting different datasets in their own repository and utilizing <a href="https://github.com/DagsHub/client/blob/master/docs/index.md">DagsHub Client</a> to stream the data and train the model on multiple datasets in an efficient way using a concept called transfer learning. <strong>Stay tuned for the next article to see how this is accomplished.</strong></p><hr><h3 id="additional-resources">Additional Resources</h3><p>If you are interested in streaming the data directly from the remote repository, you can utilize the <a href="https://dagshub.com/GauravMohan1/Emotion-Classification">main branch</a> of the project. The main branch utilizes DagsHub’s Direct Data Access, which is an API that connects to the remote repository in DagsHub to stream data. The scripts execute the same logic, however, it does not utilize the DVC pipeline to store files as dependencies and receive file objects. Instead, it utilizes Python Hooks to stream datasets that are already in the remote repository. Refer to the repository’s README to see how you can modify your project to stream the data directly from the remote repository.</p><p>If you have any questions, feel free to reach out. You can join our <a href="https://discord.gg/skXZZjJd2w">Discord</a>, where we’ve built a vibrant, helpful and friendly community.</p> </div> </div> </div> </div> </div> <section class="m-recommended"> <div class="l-wrapper in-recommended"> <h3 class="m-section-title in-recommended">Recommended for you</h3> <div class="m-recommended-articles"> <div class="m-recommended-slider glide js-recommended-slider"> <div class="glide__track" data-glide-el="track"> <div class="glide__slides"> <div class="m-recommended-slider__item glide__slide"> <article class="m-article-card post tag-active-learning tag-machine-learning-workflow tag-collaboration tag-data-labeling tag-data-science tag-machine-learning tag-machine-learning-production tag-mlops"> <div class="m-article-card__picture"> <a href="/blog/active-learning-your-way-to-better-models/" class="m-article-card__picture-link" aria-hidden="true" tabindex="-1"></a> <img class="m-article-card__picture-background" src="/blog/content/images/size/w600/2022/07/john-cameron-w1K9Ug_pjXw-unsplash.jpg" loading="lazy" alt=""> <a href="https://dagshub.com/blog/author/yono/" class="m-article-card__author js-tooltip" aria-label="Yono Mittlefehldt" data-tippy-content="Posted by Yono Mittlefehldt "> <div style="background-image: url(/blog/content/images/size/w100/2022/06/Yono4-color.jpg);"></div> </a> </div> <div class="m-article-card__info"> <a href="https://dagshub.com/blog/tag/active-learning/" class="m-article-card__tag">Active Learning</a> <a href="/blog/active-learning-your-way-to-better-models/" class="m-article-card__info-link" aria-label="Active Learning Your Way to Better Models"> <div> <h2 class="m-article-card__title js-article-card-title " title="Active Learning Your Way to Better Models"> Active Learning Your Way to Better Models </h2> </div> <div class="m-article-card__timestamp"> <span>2 years ago</span> <span>&bull;</span> <span>10 min read</span> </div> </a> </div> </article> </div> <div class="m-recommended-slider__item glide__slide"> <article class="m-article-card post tag-ci-cd tag-machine-learning-workflow tag-github tag-machine-learning-production tag-streamlit tag-tutorials tag-mlops"> <div class="m-article-card__picture"> <a href="/blog/ci-cd-for-machine-learning-test-and-and-deploy-your-ml-model-with-github-actions/" class="m-article-card__picture-link" aria-hidden="true" tabindex="-1"></a> <img class="m-article-card__picture-background" src="/blog/content/images/size/w600/2022/06/james-harrison-vpOeXr5wmR4-unsplash.jpg" loading="lazy" alt=""> <a href="https://dagshub.com/blog/author/khuyen/" class="m-article-card__author js-tooltip" aria-label="Khuyen Tran" data-tippy-content="Posted by Khuyen Tran "> <div style="background-image: url(//www.gravatar.com/avatar/cdfdeccf7cd7a1e8a70481674d6a6650?s&#x3D;250&amp;d&#x3D;mm&amp;r&#x3D;x);"></div> </a> </div> <div class="m-article-card__info"> <a href="https://dagshub.com/blog/tag/ci-cd/" class="m-article-card__tag">CI/CD</a> <a href="/blog/ci-cd-for-machine-learning-test-and-and-deploy-your-ml-model-with-github-actions/" class="m-article-card__info-link" aria-label="CI/CD for Machine Learning: Test and Deploy Your ML Model with GitHub Actions"> <div> <h2 class="m-article-card__title js-article-card-title " title="CI/CD for Machine Learning: Test and Deploy Your ML Model with GitHub Actions"> CI/CD for Machine Learning: Test and Deploy Your ML Model with GitHub Actions </h2> </div> <div class="m-article-card__timestamp"> <span>2 years ago</span> <span>&bull;</span> <span>9 min read</span> </div> </a> </div> </article> </div> <div class="m-recommended-slider__item glide__slide"> <article class="m-article-card post tag-active-learning tag-data-engine tag-computer-vision tag-label-studio tag-mlflow tag-data-management"> <div class="m-article-card__picture"> <a href="/blog/active-learning-pipeline-with-data-engine/" class="m-article-card__picture-link" aria-hidden="true" tabindex="-1"></a> <img class="m-article-card__picture-background" src="/blog/content/images/size/w600/2023/08/mike-benna-X-NAMq6uP3Q-unsplash.jpg" loading="lazy" alt=""> <a href="https://dagshub.com/blog/author/yono/" class="m-article-card__author js-tooltip" aria-label="Yono Mittlefehldt" data-tippy-content="Posted by Yono Mittlefehldt "> <div style="background-image: url(/blog/content/images/size/w100/2022/06/Yono4-color.jpg);"></div> </a> </div> <div class="m-article-card__info"> <a href="https://dagshub.com/blog/tag/active-learning/" class="m-article-card__tag">Active Learning</a> <a href="/blog/active-learning-pipeline-with-data-engine/" class="m-article-card__info-link" aria-label="Tutorial: Build an Active Learning Pipeline using Data Engine"> <div> <h2 class="m-article-card__title js-article-card-title " title="Tutorial: Build an Active Learning Pipeline using Data Engine"> Tutorial: Build an Active Learning Pipeline using Data Engine </h2> </div> <div class="m-article-card__timestamp"> <span>a year ago</span> <span>&bull;</span> <span>10 min read</span> </div> </a> </div> </article> </div> </div> </div> <div data-glide-el="controls" class="glide__arrows js-controls"> <button data-glide-dir="<" class="m-icon-button filled in-recommended-articles glide-prev" aria-label="Previous"> <span class="icon-arrow-left" aria-hidden="true"></span> </button> <button data-glide-dir=">" class="m-icon-button filled in-recommended-articles glide-next" aria-label="Next"> <span class="icon-arrow-right" aria-hidden="true"></span> </button> </div> </div> </div> </div> </section> </div> </article> </main> <div class="video-modal"> <div class="video-modal-container"> <div class="video-modal-iframe"> <button><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M20 20L4 4m16 0L4 20"></path></svg></button> <div> </div> </div> </div> </div> <div class="m-search js-search" role="dialog" aria-modal="true" aria-label="Search"> <button class="m-icon-button outlined as-close-search js-close-search" aria-label="Close search"> <span class="icon-close" aria-hidden="true"></span> </button> <div class="m-search__content"> <form class="m-search__form"> <div class="pos-relative"> <span class="icon-search m-search-icon" aria-hidden="true"></span> <label for="search-input" class="sr-only"> Type to search </label> <input id="search-input" type="text" class="m-input in-search js-input-search" placeholder="Type to search"> </div> </form> <div class="js-search-results hide"></div> <p class="m-not-found align-center hide js-no-results"> No results for your search, please try with something else. </p> </div> </div> <div class="site-pre-footer"> <div class="container"> <div class="content-wrapper"> <h3 class="title">Manage your unstructured data. Scale to millions of experiments today.</h3> <p class="description">See how leading data scientists manage their data.</p> <div class="button-group"> <a href="/book-a-demo/" target="" class="btn btn__lg btn--white-outline" data-analytics-event="Footer_BookADemo_Clicked">Book A Demo</a> <a href="https://dagshub.com/user/sign_up" target="" class="btn btn__lg btn--primary" data-analytics-event="Footer_StartFree_Clicked">Start Free</a> </div> </div> </div> </div> <div class="site-footer"> <div class="container"> <div class="site-footer__wrap"> <div class="site-footer__logo"> <div class="site-logo"> <a href="https://dagshub.com/" class="custom-logo-link" rel="home" aria-current="page"><img width="143" height="40" src="https://dagshub.com/wp-content/uploads/2024/04/dagshab.svg" class="custom-logo" alt="DagsHub" decoding="async"></a> </div> <div class="site-footer__social"> <!-- <h3 class="wdiget-title">Follow us</h3> --> <ul class="social-list"> <li class="social-list__item"> <a href="https://twitter.com/TheRealDAGsHub" target="_blank" class="social-list__link"><svg class="svg-icon icon-twitter" width="18" height="18" "=""><use xlink:href="/assets/images/icons.svg?ver=1717065551#icon-twitter"></use></svg><span class="screen-reader-text"></span></a> </li> <li class="social-list__item"> <a href="https://www.linkedin.com/company/dagshub" target="_blank" class="social-list__link"><svg class="svg-icon icon-linkedin" width="18" height="18" "=""><use xlink:href="/assets/images/icons.svg?ver=1717065551#icon-linkedin"></use></svg><span class="screen-reader-text"></span></a> </li> <li class="social-list__item"> <a href="https://youtube.com/c/dagshub" target="_blank" class="social-list__link"><svg class="svg-icon icon-youtube" width="18" height="18" "=""><use xlink:href="/assets/images/icons.svg?ver=1717065551#icon-youtube"></use></svg><span class="screen-reader-text"></span></a> </li> <li class="social-list__item"> <a href="https://discord.com/invite/9gU36Y6" target="_blank" class="social-list__link"><svg class="svg-icon icon-discord" width="18" height="18" "=""><use xlink:href="/assets/images/icons.svg?ver=1717065551#icon-discord"></use></svg><span class="screen-reader-text"></span></a> </li> </ul> </div> <img src="https://dagshub.com/wp-content/uploads/2024/04/image-54.png" alt="" class="bottom_logo"> </div> <div class="site-footer__frame"> <div class="site-footer__holder"> <div class="site-footer__nav"> <ul id="menu-pro-footer-menu" class="footer-nav"><li id="menu-item-14" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-14"><a>Resources</a> <ul class="sub-menu"> <li id="menu-item-15" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-15"><a href="https://dagshub.com/docs">Docs</a></li> <li id="menu-item-16" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-16"><a href="https://dagshub.com/blog">Blog</a></li> <li id="menu-item-101" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-101"><a href="/datasets/">Datasets</a></li> <li id="menu-item-1586" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1586"><a href="/glossary/">Glossary</a></li> <li id="menu-item-2247" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2247"><a href="https://dagshub.com/blog/tag/case-study/">Case Studies</a></li> <li id="menu-item-2244" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2244"><a href="https://dagshub.com/blog/tag/tutorials/">Tutorials &amp; Webinars</a></li> </ul> </li> <li id="menu-item-1708" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-1708"><a>Product</a> <ul class="sub-menu"> <li id="menu-item-2076" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2076"><a href="https://dagshub.com/data-engine/">Data Engine</a></li> <li id="menu-item-2250" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2250"><a href="https://dagshub.com/use-cases/llm/">LLMs</a></li> <li id="menu-item-1463" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1463"><a href="https://dagshub.com/product/">Platform</a></li> <li id="menu-item-1711" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1711"><a href="https://dagshub.com/enterprise/">Enterprise</a></li> <li id="menu-item-2464" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2464"><a href="https://dagshub.com/pricing">Pricing</a></li> </ul> </li> <li id="menu-item-2347" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-2347"><a>Company</a> <ul class="sub-menu"> <li id="menu-item-2348" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2348"><a href="https://dagshub.com/about">About</a></li> <li id="menu-item-2349" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2349"><a href="https://dagshub.com/careers">Careers</a></li> <li id="menu-item-2350" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2350"><a href="https://dagshub.com/contact-us/">Contact us</a></li> </ul> </li> <li id="menu-item-18" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-18"><a>Community</a> <ul class="sub-menu"> <li id="menu-item-17" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-17"><a href="https://dagshub.com/explore/repos">Explore</a></li> </ul> </li> </ul> </div> <div class="site-footer__info"> </div> </div> </div> <div class="footer_subcscription"> <div class="wpcf7 js" id="wpcf7-f2374-o1" lang="en-US" dir="ltr"> <div class="screen-reader-response"><p role="status" aria-live="polite" aria-atomic="true"></p> <ul></ul></div> <form action="/#wpcf7-f2374-o1" method="post" class="wpcf7-form init" aria-label="Contact form" novalidate="novalidate" data-status="init"> <div style="display: none;"> <input type="hidden" name="_wpcf7" value="2374"> <input type="hidden" name="_wpcf7_version" value="5.8.4"> <input type="hidden" name="_wpcf7_locale" value="en_US"> <input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f2374-o1"> <input type="hidden" name="_wpcf7_container_post" value="0"> <input type="hidden" name="_wpcf7_posted_data_hash" value=""> <input type="hidden" name="_wpcf7_recaptcha_response" value="03AFcWeA4uj_aRc8aqV6-AMa3S2nwbXoJUrg1L40giuqdchHOq_JcNlanE7TtT7mEAnRdQPseB8ahQoj1M1z7ruAH-lsUT-wOx3SmVYjszVfDoGIs2QlJWN7xgWlQEdD43woDSYmlNLXCC9XsBAMdMRiPtmY6-sjaVVEReUmcys9Sq5_uL0aNXxKkoL3SZvQZTW5sC0JO2eMikeoDobVCGpC3YlJG-nYT3mFaNjCxn7i-p2M_K7cFG9PUYpJNEqO-LOcW906Nf8sb1MKDAGWMhMBapyPxryKux6euldj2DhALMUW7jmNwhpaK9h7QaLgnbYy2JEo4lvcrQWQ7YnFV-DePKnnlYYudX-_wDbOxFf53Jo2SZkfKfFl3bYXDDalTLyp3hkCzI8Z69putSHsAeDDccflIRKq2qSWdGbOB1VdDwFsFz5oLCDU956C52phb_B36_22QdpFW_9qUiEfsFE_dv6cFop-AcEZ0Je2PXXM8iEK888LKoLi6HkH0aD8geB18vSxfJbr8RIZG1XNVpi1PuZxBqa_USXGy4NOWWCfmvfyo5SlZnbgnIiGfoWmFnvq0JZ6SDP0ZWxOgIIXeqDbyQ6uh942-NFho6peSdmLofXeGQDQIttjnDZM7D497GVTXhEpLHjeLIRb-FkyqiFmJM20aNEmi4zqA0r45ogEBcH24XkVWHtzK6b_owMEemE0KAeEkvJVa-32W1606ZooU0cxM3A6oCSNyF56r8XOW4_GsUxB1GXkW9M5Pd0Rktg2dREMTbYoyl9j541U-_skQQqx8JgRI8M8QEouZQwLPGKZkXZpNYWBGauNqyqUS5mu7nM9JP8g4Y-ad1ovzZSPxJplfCZxlJnMNz7GoRhN2ztM5eX1ZZwUxTEpLOHXIPUDL_VXBpisk9M_NeK1mSEmSNVO4gshOPBJs5ZSG2Uoy2sTAywrYyQahV7JIgC_V40RR49t_WyWAsdcjpVftgqyiEf6xZJmWHC8VXMRJMPfQpOkq0U8AZic0QVRfshiMiKpOHM-ZP7ux9kpzDBGZ4drQ2jJj2-rLlgHISsZ6k_wNHam7AZV1bOjbZUVg-nF5gp1IIZoBylMU1sqWhd_H0HdoKyb9QkE1-Vj_pSgGUnR4A-WbCA3xJXUow_zLekDj48e3WLxJVzyuhHCosBx-3WFi113Fu9-DXunhkTIpwv_uMjOF7DAIkbKSARbObhYj1SslmsakCY0fYgePE4DXJlNCTyFOyMneWtA3hENxzkZMb7QujC7z44YdzcHaNeX3ELEIYX2TSW8fqDv0_7eiNH5iC0lqRZ4TulmzeEjlqRW0HiNPn-Gerlw8FJljfGXW5_U0nOcXLb0N0_SREwHXIaOwO-zgVSBpCo_LlV7aMFDTqPFcmFX2B1rBIuHc8HVAmUWgolsEqJGbJUSQnsgGBQKSycBY7cq6cMSkx0F2dyaoP1Fs3ShKgTZ11LmLt2WEdjjaKdDM-bk7KoxmZxAC3D8EgdTibmxEHMhkKYGu0BxNUesCLaY5L_mRB3tXyKFYHxL9U46BslSwiBbYb-gMSQX-t9NQR4OGhv5shptwufrEPu-fOBv1LPXUid9sVDSEdRRNnhaV8BPHo9iHEuqv5NBfCbEID4-AOYrjsNFjv3dOuQPZe6soXmuh-Ic4A21KYNwOBvm0s9B6cbJT3OjVgy0rpdt_yFa5oa8EJNkNWEJzAw8l-SCVSKVp0OK7inEJHA3OMgYv784rZJxbPzvXy1NPyEqOT-T814_VN2pCFoO6NQ4XlHe7AdBn6Z_dTQipze62UHLrTrP3pwy9GWZIp4NeXdnCq4zLNpa339wKBT00WYNbL8e5qAYdm7g6ONP-rybJhtMeEXw5EZgq8ZvqmVgPEWQvZlQQnZbLtH6DpMnUeYGNwt9OS4xM0gMcnRxgLN8bG26-L-HGWcQJAboHP04ZDhOpx3iJfcFoKJy8JjVRDaXDbCaV4aLuS2G5IOPaUp9qYTRZOvtikUru6FVFcMzBHLZPbZg2l-Y1NfoFiuUDDhMuWdrcsUrHpgXva2CospJ2LWpjZnml4cROYxHfJQKNF6BlDAtgwInchv7wQfechNV-gPFKnCuR7raRbLuEGa6hAhx2PxyqSMeEtLyfe7Ur2V-TzMAvmbt7vFADS6brXDsc9OCJTLyV5UMT2EZ46Eqx5fXpXSc8pPgB5ZxL3vMTSQCfqjoUzBc3d_9OkOtrcHB7jc8HWgAE"> </div> <div class="footer-subcription-box"> <h3 class="title">ML Newsletter</h3> <p class="description">Top MLOps articles, case studies, events (and more) in your inbox every month</p> <div class="form-wrap c-form-subscription"> <div class="c-form-primary__field"><span class="wpcf7-form-control-wrap" data-name="your-email"><input size="40" class="wpcf7-form-control wpcf7-email wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-email" autocomplete="email" aria-required="true" aria-invalid="false" placeholder="Email" value="" type="email" name="your-email"></span></div> <input class="wpcf7-form-control wpcf7-submit has-spinner" type="submit" value="Subscribe"><span class="wpcf7-spinner"></span> </div> <div id="customMessage" style="display: none;"> You're subscribed! Check your inbox for exciting updates! </div> </div><div class="wpcf7-response-output" aria-hidden="true"></div> </form> </div> </div> </div> <div class="site-footer__row"> <div class="site-footer__copy">©2024 © Copyright Dagshub 2023</div> </div> </div> <div class="elipse-background"></div> <div class="elipse-background right"></div> </div> <div class="m-alert success subscribe js-alert" data-notification="subscribe"> Great! You&#x27;ve successfully subscribed. <button class="m-alert__close js-notification-close" aria-label="Close"> <span class="icon-close"></span> </button> </div> <div class="m-alert success signup js-alert" data-notification="signup"> Great! Next, complete checkout for full access. <button class="m-alert__close js-notification-close" aria-label="Close"> <span class="icon-close"></span> </button> </div> <div class="m-alert success signin js-alert" data-notification="signin"> Welcome back! You&#x27;ve successfully signed in. <button class="m-alert__close js-notification-close" aria-label="Close"> <span class="icon-close"></span> </button> </div> <div class="m-alert success checkout js-alert" data-notification="checkout"> Success! Your account is fully activated, you now have access to all content. <button class="m-alert__close js-notification-close" aria-label="Close"> <span class="icon-close"></span> </button> </div> <script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver%2CPromise%2CArray.prototype.includes%2CString.prototype.endsWith%2CString.prototype.startsWith%2CObject.assign%2CNodeList.prototype.forEach"></script> <script defer src="/blog/assets/js/manifest.js?v=d16ee3eaf3"></script> <script defer src="/blog/assets/js/vendor/content-api.min.js?v=d16ee3eaf3"></script> <script defer src="/blog/assets/js/vendor.js?v=d16ee3eaf3"></script> <script defer src="/blog/assets/js/app.js?v=d16ee3eaf3"></script> <script defer src="/blog/assets/js/post.js?v=d16ee3eaf3"></script> <!-- script tag --> <!-- prism.js --> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/prism.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/components/prism-bash.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/components/prism-python.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/components/prism-r.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/components/prism-core.min.js" integrity="sha512-9khQRAUBYEJDCDVP2yw3LRUQvjJ0Pjx0EShmaQjcHa6AXiOv6qHQu9lCAIR8O+/D8FtaCoJ2c0Tf9Xo7hYH01Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/plugins/autoloader/prism-autoloader.min.js" integrity="sha512-fTl/qcO1VgvKtOMApX2PdZzkziyr2stM65GYPLGuYMnuMm1z2JLJG6XVU7C/mR+E7xBUqCivykuhlzfqxXBXbg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10