{"id":1240,"date":"2019-12-19T08:51:53","date_gmt":"2019-12-19T08:51:53","guid":{"rendered":"https:\/\/www.gravityjack.com\/?p=1240"},"modified":"2023-11-28T14:30:40","modified_gmt":"2023-11-28T14:30:40","slug":"understanding-neural-networks","status":"publish","type":"post","link":"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/","title":{"rendered":"UNDERSTANDING YOUR NEURAL NETWORK: A DEVELOPER\u2019S PERSPECTIVE"},"content":{"rendered":"\n<p>The life of a developer is often incredibly rewarding. We get to take an idea for an app or software that doesn\u2019t currently exist and bring it to life through code! However, that\u2019s not to say there isn\u2019t a fair share of headaches acquired along the way, but if it were easy everyone would be doing it. For this particular writeup, we are going to focus on the creation of neural networks (the foundation of machine learning) and how to overcome potential issues that may arise when creating them.<\/p>\n\n\n\n<p><a href=\"https:\/\/pathmind.com\/wiki\/neural-network\" target=\"_blank\" rel=\"noreferrer noopener\">Neural networks<\/a>&nbsp;are like any project, they take a significant amount of time and energy to get just right. In this example, we are getting ready to push a complex solution for image classification. Just as we feed the network an image for classification, low and behold it spits out the wrong answer (of course). What happens now?&nbsp;<\/p>\n\n\n\n<p>Usually, the team gathers around and shouts a million and one suggestions (\u201cit must be the blue in the background\u201d, \u201cmercury is in retrograde\u201d,&nbsp; or an office favorite, \u201cmaybe remove the labels!\u201d). While some of these suggestions are testable, the effort needed to verify these features isn\u2019t necessarily feasible. Even if there isn\u2019t anyone shouting suggestions, we still find ourselves scrambling around using instinct and experience to diagnose the problem. The end result could be tons of wasted cycles spent guessing at solutions and then testing them again.&nbsp;<\/p>\n\n\n\n<p>Or perhaps a wonderful network is built that passes all the tests created for it. It\u2019s proudly presented it to a client only to have them ask, \u201chow can we trust it?\u201d. One way is pointing to all the tests the neural network completed and present various metrics, but unless the clients are already well versed in&nbsp;<a href=\"https:\/\/gravityjack.com\/news\/machine-learning-development\/\" target=\"_blank\" rel=\"noreferrer noopener\">Machine Learning<\/a>, they won\u2019t feel very satisfied.&nbsp;&nbsp;<\/p>\n\n\n\n<p>Instead, in a second scenario, we again have constructed a fully functional network and it again passes all tests, solving the client\u2019s problem. But then someone asks \u201cwhat have we learned?\u201d Beyond predicting some value, how can we use this network to help plot future strategy?<\/p>\n\n\n\n<p>In the first case, we hope to see light at the end of a seemingly endless cycle of guess and check that usually accompanies network development. We want to understand why a network made its decision and use that to&nbsp;guide our experiments.<\/p>\n\n\n\n<p>In the second case, we seek to provide another measure of the network\u2019s success and seek to bolster \u201cconfidence\u201d in its decisions. One of the reasons people love algorithms like&nbsp;<a href=\"https:\/\/towardsdatascience.com\/support-vector-machine-introduction-to-machine-learning-algorithms-934a444fca47\" target=\"_blank\" rel=\"noreferrer noopener\">SVMs<\/a>,&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Nearest_neighbour_algorithm\" target=\"_blank\" rel=\"noreferrer noopener\">Nearest Neighbor<\/a>, or&nbsp;<a href=\"https:\/\/towardsdatascience.com\/a-comprehensive-study-of-linear-vs-logistic-regression-to-refresh-the-basics-7e526c1d3ebe\" target=\"_blank\" rel=\"noreferrer noopener\">Linear\/Logistic&nbsp;<\/a><a href=\"https:\/\/towardsdatascience.com\/a-comprehensive-study-of-linear-vs-logistic-regression-to-refresh-the-basics-7e526c1d3ebe\" target=\"_blank\" rel=\"noreferrer noopener\">Regression<\/a>&nbsp;is that the&nbsp;training algorithms output some data structure that can be easily examined. There are a few coefficients or exemplars that can be pointed to or visualized. One can easily say how a model makes its decisions and show that they are explainable.&nbsp;With Neural Networks, we don\u2019t get that benefit right away.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"577\" height=\"381\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/regression-equation-cartoon-1.png\" alt=\"\" class=\"wp-image-1242\" srcset=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/regression-equation-cartoon-1.png 577w, https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/regression-equation-cartoon-1-300x198.png 300w, https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/regression-equation-cartoon-1-500x330.png 500w\" sizes=\"(max-width: 577px) 100vw, 577px\" \/><figcaption class=\"wp-element-caption\">Image credit: resources.esri.com<\/figcaption><\/figure><\/div>\n\n\n<p>One of the reasons why linear models and the like are so popular in the Social Sciences is that experimenters want to both predict their dataset accurately and know the reason in regard to the underlying data structure. Which variable is likely to predict student success?&nbsp;Does the variable have the same effect for two sub-populations? If we want to boost sales, which strategy is more likely to succeed? These are questions that are easy to answer if there are any coefficients. Not so with a neural network.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Feature Visualizations And Attribution<\/h5>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"979\" height=\"466\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/edgedetection-1.png\" alt=\"\" class=\"wp-image-1243\" srcset=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/edgedetection-1.png 979w, https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/edgedetection-1-300x143.png 300w, https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/edgedetection-1-500x238.png 500w, https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/edgedetection-1-800x381.png 800w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><figcaption class=\"wp-element-caption\">Image credit: medium.com<\/figcaption><\/figure><\/div>\n\n\n<p>These are the two biggest subfields of neural network understanding. In traditional machine learning, we typically refer to features as the direct input to our learning algorithm \u2014 which can be viewed as a pipeline. Start with raw data, transform that data into features, and then run the machine learning algorithm. For example, in face detection, it was the standard to first run edge detection on an image to produce an image of edges, then feed that image to the machine learning algorithm. Generally, the selection of features was a carefully considered part of the process and was often called feature engineering.<\/p>\n\n\n\n<p>In today\u2019s deep networks, the process of feature engineering is one of the tasks that the network must accomplish. The choice of features is something that the network is supposed to learn through training. The theory is that the lower-level layers in the model learn features like edge detection while the upper levels learn more abstract concepts. How true is that? That is the question that feature visualization is supposed to answer. This is usually done by taking a group of neurons within a network and deriving a picture of inputs that lead to group activation. Is there a picture of what typically makes this group of neurons happy? The hope is that these pictures will reveal which features were learned. For example, when examining select neurons in&nbsp;<a href=\"https:\/\/research.google\/pubs\/pub43022\/\" target=\"_blank\" rel=\"noreferrer noopener\">GoogleNet<\/a>, researchers generated an image for a group of neurons that looks suspiciously like a dog\u2019s ear. They reasoned that these neurons were a dog ear detector.<\/p>\n\n\n\n<p>Attribution asks the question, \u201cwhich portions of the input are responsible for the network\u2019s response?\u201d When the inputs are graphical images, the question changes to what portion of the input image are most influencing the eventual outcome of the network. The hope here is to produce a graphic that highlights which image portions the network \u201cpays attention to\u201d and which parts drive network decisions.<\/p>\n\n\n\n<p>Thankfully, there has been a lot of work done in these areas. In one hour of searching, we managed to find some 50 academic papers on the subject and several blog posts. While these papers are fascinating and fun to read, they don\u2019t answer the practical question of \u201chow useful are these ideas and tools?\u201d Can these concepts be used in a production environment? Do they meet the business needs outlined above?<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">The Questions We Want To Answer<\/h5>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"200\" height=\"200\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/Gravity-Jack-Neural-Netowrks-1-300x300-1.jpg\" alt=\"\" class=\"wp-image-1244\" srcset=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/Gravity-Jack-Neural-Netowrks-1-300x300-1.jpg 200w, https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/Gravity-Jack-Neural-Netowrks-1-300x300-1-150x150.jpg 150w\" sizes=\"(max-width: 200px) 100vw, 200px\" \/><\/figure><\/div>\n\n\n<p>We find current theoretical and mathematical research quite fascinating. However, we have practical work that involves getting Deep Neural Networks to perform specific tasks. We would like to see if any of these insights and tools are going to help us with that. Can these tools actually tell us what is wrong or right with our network? Will this knowledge actually help us to build a better network?<\/p>\n\n\n\n<p>To that end, we propose a set of ongoing experiments. First, we will find a small enough object classification dataset. We will then construct a small network that attempts to classify the dataset. This network will have some flaws. We will then try out various neural understanding methods and see if it helps us do our job and fix our network.&nbsp; Along the way, we intend to release as much code as we can (no proprietary technology) as well as HOW TOs and tutorials on these techniques. We will also try to explain the techniques in a simple way. Our hope is to demonstrate the relative usefulness of these techniques and give you the tools to use them in your own workflows. To that point, don\u2019t forget to follow us on social media as we release our findings!<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The life of a developer is often incredibly rewarding. We get to take an idea for an app or software that doesn\u2019t currently exist and bring it to life through code! However, that\u2019s not to say there isn\u2019t a fair share of headaches acquired along the way, but if it were easy everyone would be <a href=\"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/\" class=\"more-link\">&#8230;<span class=\"screen-reader-text\">  UNDERSTANDING YOUR NEURAL NETWORK: A DEVELOPER\u2019S PERSPECTIVE<\/span><\/a><\/p>\n","protected":false},"author":9,"featured_media":1241,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[9,3],"tags":[],"class_list":["post-1240","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ar-news","category-news"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Understanding Your Neural Network: A Developer&#039;s Perspective<\/title>\n<meta name=\"description\" content=\"Ready to feed a network an image for classification, but getting the wrong answer? Our team explains what can be done to improve your neural network.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding Your Neural Network: A Developer&#039;s Perspective\" \/>\n<meta property=\"og:description\" content=\"Ready to feed a network an image for classification, but getting the wrong answer? Our team explains what can be done to improve your neural network.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/\" \/>\n<meta property=\"og:site_name\" content=\"Gravity Jack\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-19T08:51:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-28T14:30:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/NeuralNetworksDeveloper-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"344\" \/>\n\t<meta property=\"og:image:height\" content=\"194\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Gravity Admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gravity Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/\",\"url\":\"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/\",\"name\":\"Understanding Your Neural Network: A Developer's Perspective\",\"isPartOf\":{\"@id\":\"https:\/\/www.gravityjack.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/NeuralNetworksDeveloper-1.jpg\",\"datePublished\":\"2019-12-19T08:51:53+00:00\",\"dateModified\":\"2023-11-28T14:30:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.gravityjack.com\/#\/schema\/person\/63c79a7e30c630a69e6e003ef7476fcc\"},\"description\":\"Ready to feed a network an image for classification, but getting the wrong answer? Our team explains what can be done to improve your neural network.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/#primaryimage\",\"url\":\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/NeuralNetworksDeveloper-1.jpg\",\"contentUrl\":\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/NeuralNetworksDeveloper-1.jpg\",\"width\":344,\"height\":194},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.gravityjack.com\/#website\",\"url\":\"https:\/\/www.gravityjack.com\/\",\"name\":\"Gravity Jack\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.gravityjack.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.gravityjack.com\/#\/schema\/person\/63c79a7e30c630a69e6e003ef7476fcc\",\"name\":\"Gravity Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gravityjack.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/aa3d42e00068a5cdefa39bab3155196c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/aa3d42e00068a5cdefa39bab3155196c?s=96&d=mm&r=g\",\"caption\":\"Gravity Admin\"},\"url\":\"https:\/\/www.gravityjack.com\/author\/gjmagravityjack-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding Your Neural Network: A Developer's Perspective","description":"Ready to feed a network an image for classification, but getting the wrong answer? Our team explains what can be done to improve your neural network.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/","og_locale":"en_US","og_type":"article","og_title":"Understanding Your Neural Network: A Developer's Perspective","og_description":"Ready to feed a network an image for classification, but getting the wrong answer? Our team explains what can be done to improve your neural network.","og_url":"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/","og_site_name":"Gravity Jack","article_published_time":"2019-12-19T08:51:53+00:00","article_modified_time":"2023-11-28T14:30:40+00:00","og_image":[{"width":344,"height":194,"url":"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/NeuralNetworksDeveloper-1.jpg","type":"image\/jpeg"}],"author":"Gravity Admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Gravity Admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/","url":"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/","name":"Understanding Your Neural Network: A Developer's Perspective","isPartOf":{"@id":"https:\/\/www.gravityjack.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/#primaryimage"},"image":{"@id":"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/#primaryimage"},"thumbnailUrl":"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/NeuralNetworksDeveloper-1.jpg","datePublished":"2019-12-19T08:51:53+00:00","dateModified":"2023-11-28T14:30:40+00:00","author":{"@id":"https:\/\/www.gravityjack.com\/#\/schema\/person\/63c79a7e30c630a69e6e003ef7476fcc"},"description":"Ready to feed a network an image for classification, but getting the wrong answer? Our team explains what can be done to improve your neural network.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gravityjack.com\/news\/understanding-neural-networks\/#primaryimage","url":"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/NeuralNetworksDeveloper-1.jpg","contentUrl":"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/NeuralNetworksDeveloper-1.jpg","width":344,"height":194},{"@type":"WebSite","@id":"https:\/\/www.gravityjack.com\/#website","url":"https:\/\/www.gravityjack.com\/","name":"Gravity Jack","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.gravityjack.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.gravityjack.com\/#\/schema\/person\/63c79a7e30c630a69e6e003ef7476fcc","name":"Gravity Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gravityjack.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/aa3d42e00068a5cdefa39bab3155196c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/aa3d42e00068a5cdefa39bab3155196c?s=96&d=mm&r=g","caption":"Gravity Admin"},"url":"https:\/\/www.gravityjack.com\/author\/gjmagravityjack-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/posts\/1240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/comments?post=1240"}],"version-history":[{"count":0,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/posts\/1240\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/media\/1241"}],"wp:attachment":[{"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/media?parent=1240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/categories?post=1240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/tags?post=1240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}