{"id":1107,"date":"2021-02-01T09:12:12","date_gmt":"2021-02-01T09:12:12","guid":{"rendered":"https:\/\/www.gravityjack.com\/?p=1107"},"modified":"2023-11-28T13:34:14","modified_gmt":"2023-11-28T13:34:14","slug":"understanding-neural-network-part-2","status":"publish","type":"post","link":"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/","title":{"rendered":"UNDERSTANDING YOUR NEURAL NETWORK: PART 2"},"content":{"rendered":"\n<h5 class=\"wp-block-heading\"><strong>THE RUNNING EXAMPLE<\/strong><\/h5>\n\n\n\n<p>Welcome back! For those just joining us, we encourage you to&nbsp;<a href=\"https:\/\/gravityjack.com\/news\/understanding-neural-networks\/\">take a look at our first post<\/a>&nbsp;in the neural understanding series to make sure you are up to date. In that article, we described our intention to take a neural network through the various techniques of neural understanding to see if they could open up the black box of neural networks. This post will describe the working example that will be used throughout the rest of the series.&nbsp;<\/p>\n\n\n\n<p>Notebooks, code, and results can be found&nbsp;<a href=\"https:\/\/bitbucket.org\/gravityjack\/attribution_blog_code\/src\/master\/\">here<\/a>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>DESCRIPTION<\/strong><\/h5>\n\n\n\n<p>When looking for free datasets, the first place to check was the venerable&nbsp;<a href=\"https:\/\/archive.ics.uci.edu\/ml\/datasets.php\">UCI ML Database<\/a>.<\/p>\n\n\n\n<p>There were several criteria for choosing the dataset:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Computer vision-related<\/li>\n\n\n\n<li>Small enough to run without a GPU<\/li>\n\n\n\n<li>Plays well with simple networks<\/li>\n\n\n\n<li>Extra testing data easily acquired<\/li>\n<\/ul>\n\n\n\n<p>The final choice was&nbsp;<a href=\"https:\/\/archive.ics.uci.edu\/ml\/datasets\/CMU+Face+Images\">CMU Faces<\/a>, a dataset composed of graphical images of human faces. The faces are either facing left, right, up, or forward (from the subject\u2019s perspective; subject left is camera right). The subject may be wearing sunglasses or not. Finally, the subject may be expressing an emotion: happy, sad, or neutral. The dataset exists as directories based on the subject\u2019s username and the images are stored in PGM format. Furthermore, there are 3 different sizes to the images: 128\u00d7120, 64\u00d760, 32\u00d730.<\/p>\n\n\n\n<p>The basic task of this dataset is to determine the state of the subject\u2019s head. For this example, we chose to detect if the subject was facing left (or camera right ).&nbsp;<\/p>\n\n\n<div class=\"wp-block-image img_caption\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"378\" height=\"116\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn1-1.png\" alt=\"\" class=\"wp-image-1108\" style=\"width:492px;height:undefinedpx\" srcset=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn1-1.png 378w, https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn1-1-300x92.png 300w\" sizes=\"(max-width: 378px) 100vw, 378px\" \/><figcaption class=\"wp-element-caption\">Image 1: A selection of raw photos from CMU Faces. The lower resolution images have been scaled to 128\u00d7120. The second and third images are facing subject left.<\/figcaption><\/figure><\/div>\n\n\n<h5 class=\"wp-block-heading\"><strong>Preprocessing<\/strong><\/h5>\n\n\n\n<p>Any ML enthusiast knows that all datasets need preprocessing. With that in mind, here are the steps that we took. You can find most of our process in&nbsp;<strong>experiments\/experiment0\/experiment0_create_dataset.ipynb<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The first problem that came up when using the&nbsp;<a href=\"https:\/\/pypi.org\/project\/Pillow\/2.2.1\/\">python PIL library<\/a>&nbsp;was that&nbsp; we could not open some of the pgm files. This was fixed by converting them to png files:&nbsp;<strong>mogrify -format png *.pgm.&nbsp;<\/strong><\/li>\n\n\n\n<li>Next was to create a directory of images and a file that describes the ground truth. Again, see&nbsp;<strong>experiment0_create_dataset.ipynb<\/strong>&nbsp;for the code used to do this. There were three goals in mind:\n<ol class=\"wp-block-list\">\n<li>Create a classifier that would detect when the subject was looking left. Since the raw dataset encodes the pose of the subject\u2019s face in the filename, parsing file names with the keyword \u2018left\u2019 was necessary. \u201c1\u201d would be stored in the ground truth file if the subject was looking to the left, \u201c0\u201d otherwise.&nbsp;<\/li>\n\n\n\n<li>The original dataset stores the input files in subdirectories identified by the username of the subject. To place all the input images in one directory, we generated new file names that were integer values starting from zero and incrementing for each image. These image numbers were mapped to line numbers in the ground truth file. So, image&nbsp;<strong>000000.png<\/strong>&nbsp;had its ground truth stored in the first line of the ground truth file, image&nbsp;<strong>000001.png&nbsp;<\/strong>had its ground truth on line 2, and so on.&nbsp;<\/li>\n\n\n\n<li>Standardize on one resolution. The original raw data had resolutions of 128\u00d7120, 64\u00d760, or 32\u00d730, so we rescaled all the images to 128\u00d7128 and broke aspect ratio. If breaking aspect ratio or rescaling from smaller resolutions has an impact, perhaps the neural understanding tools will help to diagnose that.&nbsp;<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>The processed dataset can be found in&nbsp;<strong>datasets\/face1<\/strong>.&nbsp;The file&nbsp;<strong>truth.csv<\/strong>&nbsp;contains the ground truths.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image img_caption\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"383\" height=\"128\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn2-1.png\" alt=\"\" class=\"wp-image-1109\" style=\"width:492px;height:undefinedpx\" srcset=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn2-1.png 383w, https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn2-1-300x100.png 300w\" sizes=\"(max-width: 383px) 100vw, 383px\" \/><figcaption class=\"wp-element-caption\">Image 2: Processed images from CMU Faces, scaled to 128\u00d7128<\/figcaption><\/figure><\/div>\n\n\n<h5 class=\"wp-block-heading\"><strong>Training<\/strong><\/h5>\n\n\n\n<p><\/p>\n\n\n\n<p>The next thing in order is training a network on the dataset. These training processes can be found in&nbsp;<strong>experiments\/experiment0\/experiment0_create_dataset.ipynb<\/strong>. Some things to note:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>We created a simple network with two max pool layers sandwiched between 3 convolutional layers, two dense layers, and a dropout layer then led to a soft normalized output player.&nbsp;<\/li>\n\n\n\n<li>Since the job is to classify an image as \u2018looking left\u2019 or \u2018not looking left\u2019, the output was a 2 element vector whose elements added to 1 (softmax normalized).\n<ol class=\"wp-block-list\">\n<li>The first element describes the network\u2019s confidence that the face was not looking left.&nbsp;<\/li>\n\n\n\n<li>The second element describes the network\u2019s confidence that the face was looking left. Whichever position had the highest confidence was selected as the network\u2019s decision.&nbsp;<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>The ground truth input contains a 1 or a 0 for each image. When using categorical outputs, Keras&nbsp;<a href=\"https:\/\/keras.io\/utils\/\">prefers to use a ground truth encoded<\/a>&nbsp;as [1 0] for 0, and [0 1] for 1. In other words, it prefers a ground truth with the same format as the network\u2019s output.&nbsp;<\/li>\n\n\n\n<li>The input images were opened in grayscale mode and normalized by dividing each cell by 255.&nbsp;<\/li>\n\n\n\n<li>Finally,the&nbsp;<strong>sgd&nbsp;<\/strong><a href=\"https:\/\/keras.io\/optimizers\/\">optimizer<\/a>&nbsp;was used with the&nbsp;<strong>categorial_crossentropy<\/strong>&nbsp;<a href=\"https:\/\/keras.io\/losses\/\">loss function<\/a>. The&nbsp;<a href=\"https:\/\/keras.io\/metrics\/\">reporting metric<\/a>&nbsp;was&nbsp;<strong>accuracy<\/strong>.<\/li>\n\n\n\n<li>A random 10 percent was cut out of the dataset and withheld from training for use as a testing set.&nbsp;&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>After making 10 passes (or 10 epochs) through the training data, desired results were achieved. Here are the results for a single sample run of the notebook. Multiple runs achieved similar results.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1685\/1685 [==============================] \u2013 29s 17ms\/step \u2013 loss: 0.0318 \u2013 acc: 0.9893<br>test&nbsp;results incoming\u2026<br>187\/187 [==============================] \u2013 1s 8ms\/step<br>[0.029746012331389966, 0.9946524064171123]<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>After just 10 iterations, the accuracy on the training set sat at about 99%. It was initially thought that looking left would be harder to detect. Running on the testing set did even better by achieving over 99% accuracy. Wow! The model used is included in:&nbsp;<strong>experiments\/experiment0\/results\/model\/modela.hdf5<\/strong>.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Extra Testing Data<\/strong><\/h5>\n\n\n\n<p>The network is now operating as intended and running the notebook several times also yielded the desired results. However, the network still needs a test run&nbsp; on real world data not found in the dataset.&nbsp; Thankfully, getting additional datasets to test is fairly easy.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>We recruited three Gravity Jack employees as test subjects: Gilbert, Ryan, and Sarah. They were told to look up, left, and right. Sunglasses or emotions weren\u2019t part of the test so no direction was provided on that front.&nbsp;<\/li>\n\n\n\n<li>Each video was converted into a series of images using ffmpeg. The images were cropped and scaled so that they were 128\u00d7128.&nbsp; We used:&nbsp;<strong>ffmpeg -i *mp4 -vf \u201ccrop=in_w:in_w:0:(in_h-in_w)\/2,scale=128:128\u201d<\/strong><strong>&nbsp;blank\/img_%04d.png<\/strong>&nbsp;<\/li>\n\n\n\n<li><strong>truth.csv<\/strong>&nbsp;was created for each set of images by hand \u2014 which turned out to be pretty fun.&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>The results are in&nbsp;<strong>datasets\/testingsets\/{gilbert, ryan, sarah}<\/strong>.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"379\" height=\"128\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn3-1.png\" alt=\"\" class=\"wp-image-1110\" style=\"width:500px;height:undefinedpx\" srcset=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn3-1.png 379w, https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn3-1-300x101.png 300w\" sizes=\"(max-width: 379px) 100vw, 379px\" \/><\/figure><\/div>\n\n\n<h5 class=\"wp-block-heading\"><strong>Extra Testing Results<\/strong><\/h5>\n\n\n\n<p>The training results are presented in&nbsp;<strong>experiments\/experiments0\/experiment0_test_model.ipynb<\/strong>. Each dataset presents the value of the loss function and the reporting metric. We also count the number of&nbsp;<strong>false positives<\/strong>&nbsp;(images where the subject is NOT looking to their left, but the network reports the subject is looking left) and the number of&nbsp;<strong>false negatives<\/strong>&nbsp;(images where the subject is looking to their left but the network reports the subject is NOT looking left). Each dataset also presents 15 random false positive and 15 random false negative images. Additionally, we present the results of a typical run of the notebook.&nbsp;<\/p>\n\n\n\n<p>First, let\u2019s look at Sarah.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>361\/361 [==============================] \u2013 3s 10ms\/step<br>[0.10927987948932198, 0.9695290859551311]<br>false_positives: 5<br>false_negatives: 6<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Wow, about 97%. That never happens. Just eleven errors. Looking at some false positives, we can see some images of her looking straight at the camera.<\/p>\n\n\n<div class=\"wp-block-image img_caption\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"80\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn4-1-300x80-1.png\" alt=\"\" class=\"wp-image-1111\" style=\"width:492px;height:undefinedpx\"\/><figcaption class=\"wp-element-caption\">Image 4: The network said Sarah was looking left, but we can see this is not the case. A false positive.<\/figcaption><\/figure><\/div>\n\n\n<p>Let\u2019s look at her false negatives. Clearly, she\u2019s looking to her left.<\/p>\n\n\n<div class=\"wp-block-image img_caption\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"78\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn5-1-300x78-1.png\" alt=\"\" class=\"wp-image-1112\" style=\"width:492px;height:undefinedpx\"\/><figcaption class=\"wp-element-caption\">Image 5: The network said Sarah was NOT looking left, clearly she is.<\/figcaption><\/figure><\/div>\n\n\n<p>Next, we take a look at Gilbert.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>375\/375 [==============================] \u2013 4s 11ms\/step<br>[1.0308103105060484, 0.8666666666666667]<br>false_positives: 0<br>false_negatives: 50<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Now, 86% may sound good, but look at false negatives,&nbsp;<strong>50<\/strong>. That is the number of positive examples in that dataset. In other words, the network does not think that Gilbert looks left, even though there\u2019s photographic data to the contrary. Now, this is actually good news for our series on neural understanding. This is the sort of error that happens all the time in our line of work and one that neural understanding will hopefully help demystify.<\/p>\n\n\n<div class=\"wp-block-image img_caption\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"76\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn6-1-300x76-1.png\" alt=\"\" class=\"wp-image-1113\" style=\"width:492px;height:undefinedpx\"\/><figcaption class=\"wp-element-caption\">Image 6: False negatives, Gilbert IS looking left, but the network disagrees.<\/figcaption><\/figure><\/div>\n\n\n<p>Finally, we look at Ryan.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>559\/559 [==============================] \u2013 6s 11ms\/step<br>[0.3661229715187749, 0.8372093023255814]<br>false_positives: 20<br>false_negatives: 71<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Ugh. Even worse!&nbsp; His false positives include some shots of him looking to his right, and his false negatives are all the images where he looks to his left. What\u2019s going on?<\/p>\n\n\n<div class=\"wp-block-image img_caption\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"78\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn7-1-300x78-1.png\" alt=\"\" class=\"wp-image-1114\" style=\"width:489px;height:undefinedpx\"\/><figcaption class=\"wp-element-caption\">Image 7: Ryan\u2019s false positives. He is looking right. The network is wrong here.<\/figcaption><\/figure><\/div>\n\n<div class=\"wp-block-image img_caption\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"78\" src=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/nn8-1-300x78-1.png\" alt=\"\" class=\"wp-image-1115\" style=\"width:492px;height:undefinedpx\"\/><figcaption class=\"wp-element-caption\">Image 8: Ryan\u2019s false negatives, he is indeed looking left. These should have been classified as positive.<\/figcaption><\/figure><\/div>\n\n\n<h5 class=\"wp-block-heading\"><strong>What Next?&nbsp;<\/strong><\/h5>\n\n\n\n<p>In this post, we\u2019ve described a sample problem that might be faced in the field and produced some notebooks to run our experiments. While the networks performed well on a random split of the original dataset, they failed to work well for two out of three of our extra testing sets. The current result is a network that\u2019s learned some concepts very well, but has trouble generalizing that concept to novel data. This is a common state of affairs in machine learning. Now, instead of guessing at problems and running experiments, we can begin to explore the tools and techniques of neural understanding to see if they offer any practical benefit!<\/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 RUNNING EXAMPLE Welcome back! For those just joining us, we encourage you to&nbsp;take a look at our first post&nbsp;in the neural understanding series to make sure you are up to date. In that article, we described our intention to take a neural network through the various techniques of neural understanding to see if they <a href=\"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/\" class=\"more-link\">&#8230;<span class=\"screen-reader-text\">  UNDERSTANDING YOUR NEURAL NETWORK: PART 2<\/span><\/a><\/p>\n","protected":false},"author":9,"featured_media":1116,"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-1107","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: Part 2<\/title>\n<meta name=\"description\" content=\"We built a neural network to classify images using artificial intelligence. Part 2 of our machine learning series goes through a working example!\" \/>\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-network-part-2\/\" \/>\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: Part 2\" \/>\n<meta property=\"og:description\" content=\"We built a neural network to classify images using artificial intelligence. Part 2 of our machine learning series goes through a working example!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Gravity Jack\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-01T09:12:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-28T13:34:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/neuralnetworkblog-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=\"9 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-network-part-2\/\",\"url\":\"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/\",\"name\":\"Understanding Your Neural Network: Part 2\",\"isPartOf\":{\"@id\":\"https:\/\/www.gravityjack.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/neuralnetworkblog-1.jpg\",\"datePublished\":\"2021-02-01T09:12:12+00:00\",\"dateModified\":\"2023-11-28T13:34:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.gravityjack.com\/#\/schema\/person\/63c79a7e30c630a69e6e003ef7476fcc\"},\"description\":\"We built a neural network to classify images using artificial intelligence. Part 2 of our machine learning series goes through a working example!\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/#primaryimage\",\"url\":\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/neuralnetworkblog-1.jpg\",\"contentUrl\":\"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/neuralnetworkblog-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: Part 2","description":"We built a neural network to classify images using artificial intelligence. Part 2 of our machine learning series goes through a working example!","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-network-part-2\/","og_locale":"en_US","og_type":"article","og_title":"Understanding Your Neural Network: Part 2","og_description":"We built a neural network to classify images using artificial intelligence. Part 2 of our machine learning series goes through a working example!","og_url":"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/","og_site_name":"Gravity Jack","article_published_time":"2021-02-01T09:12:12+00:00","article_modified_time":"2023-11-28T13:34:14+00:00","og_image":[{"width":344,"height":194,"url":"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/neuralnetworkblog-1.jpg","type":"image\/jpeg"}],"author":"Gravity Admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Gravity Admin","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/","url":"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/","name":"Understanding Your Neural Network: Part 2","isPartOf":{"@id":"https:\/\/www.gravityjack.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/#primaryimage"},"image":{"@id":"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/neuralnetworkblog-1.jpg","datePublished":"2021-02-01T09:12:12+00:00","dateModified":"2023-11-28T13:34:14+00:00","author":{"@id":"https:\/\/www.gravityjack.com\/#\/schema\/person\/63c79a7e30c630a69e6e003ef7476fcc"},"description":"We built a neural network to classify images using artificial intelligence. Part 2 of our machine learning series goes through a working example!","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gravityjack.com\/news\/understanding-neural-network-part-2\/#primaryimage","url":"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/neuralnetworkblog-1.jpg","contentUrl":"https:\/\/www.gravityjack.com\/wp-content\/uploads\/2023\/11\/neuralnetworkblog-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\/1107","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=1107"}],"version-history":[{"count":0,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/posts\/1107\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/media\/1116"}],"wp:attachment":[{"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/media?parent=1107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/categories?post=1107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gravityjack.com\/wp-json\/wp\/v2\/tags?post=1107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}