{"id":956,"date":"2021-02-07T10:44:00","date_gmt":"2021-02-07T10:44:00","guid":{"rendered":"http:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/?p=956"},"modified":"2021-03-11T11:10:05","modified_gmt":"2021-03-11T11:10:05","slug":"artificial-neural-networks","status":"publish","type":"post","link":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/artificial-neural-networks\/","title":{"rendered":"Artificial Neural Networks"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"956\" class=\"elementor elementor-956\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-22ccaed elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"22ccaed\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f2bb7f5\" data-id=\"f2bb7f5\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-01fc55a elementor-widget elementor-widget-heading\" data-id=\"01fc55a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">How studying the brain is helping to build \"brains\".<\/h3>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-bbe1749 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"bbe1749\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-489d1de\" data-id=\"489d1de\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5311c34 elementor-widget elementor-widget-text-editor\" data-id=\"5311c34\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Unless you&#8217;ve been living under a rock for the last few years, you&#8217;ve probably heard of the terms machine learning and neural networks. Maybe you saw the media frenzy surrounding the Go match between GOAT Lee Sedol and the computer program alphaGo (If not, I recommend the excellent\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=WXuK6gekU1Y\" target=\"_blank\" rel=\"noopener\">documentary<\/a>\u00a0about it). Or perhaps you&#8217;ve seen some of the ethical debate surrounding artificial intelligence (AI) on the news.<\/p><p>However much you&#8217;ve been exposed to these ideas, it doesn&#8217;t matter. This post aims to introduce the concepts behind neural networks (a central component of machine learning) in an accessible way by using comparisons with how a real brain functions.<\/p><p>Let&#8217;s dive straight in with the concept of a neuron which is where the neural part of Artificial Neural Network (ANN) originates. In the brain and nervous system, neurons are specialised cells that communicate signals with each other via synapses that transmit electrical or chemical signals between neurons. I&#8217;ve included a rough diagram of a neuron here (please don&#8217;t go and show this to a neuroscientist) to help illustrate some concepts. The diagram may be simple but it shows the branching nature of the head and tail of the neuron. These branches can reach and influence many other neurons via synapses. This branching concept is one that is central to the artificial counterpart of a system of neurons, the ANN.\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4d3d44a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4d3d44a\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-17801e1\" data-id=\"17801e1\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-75f94c5 elementor-widget elementor-widget-image\" data-id=\"75f94c5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"660\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-content\/uploads\/sites\/24\/2021\/03\/neuron-copy-1024x660.jpg\" class=\"attachment-large size-large wp-image-987\" alt=\"Image of a neuron cell\" srcset=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-content\/uploads\/sites\/24\/2021\/03\/neuron-copy-1024x660.jpg 1024w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-content\/uploads\/sites\/24\/2021\/03\/neuron-copy-300x193.jpg 300w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-content\/uploads\/sites\/24\/2021\/03\/neuron-copy-768x495.jpg 768w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-content\/uploads\/sites\/24\/2021\/03\/neuron-copy-1536x990.jpg 1536w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-content\/uploads\/sites\/24\/2021\/03\/neuron-copy.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3248fca elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3248fca\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7539a26\" data-id=\"7539a26\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-80ffbf8 elementor-widget elementor-widget-text-editor\" data-id=\"80ffbf8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>A\u00a0 gif showing the operation of a ANN is shown below. Look at the features of the ANN. The large circles are called artificial neurons and the lines connecting them are called edges. These edges can be considered as behaving analogously to synapses in that they transfer signals between the (artificial) neurons. Each artificial neuron has an associated number between zero and one called its activation value. In the gif, this activation is shown in orange, a thicker border represents a stronger activation. A neuron with a high activation value can be thought of as sending a stronger signal to connected neurons.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-1de8e55 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"1de8e55\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-edf18b6\" data-id=\"edf18b6\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1f6ac5d elementor-widget elementor-widget-image\" data-id=\"1f6ac5d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"1200\" height=\"926\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-content\/uploads\/sites\/24\/2021\/03\/ANN.gif\" class=\"attachment-full size-full wp-image-995\" alt=\"Gif of an ANN in operation\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9714a2c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9714a2c\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b156327\" data-id=\"b156327\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-74576ca elementor-widget elementor-widget-text-editor\" data-id=\"74576ca\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Neurons in a ANN are organised into layers, the first layer is called the input layer and it consists of neurons that receive a signal in the form of external data (i.e. images, text, positions in a chess game etc.). In the gif, the ANN has a cute cat as an input. These can be compared to sensory neurons in the body that respond to external stimuli. The final layer is called the output layer. These neurons output a signal that corresponds to solving the problem at hand( i.e. identifying an image, the vest move to play next etc.). In between the input and output layers are the hidden layers, these hidden layers tend to deal with more abstract representations of the input that help the neural network to calculate the correct output (i.e. certain features in an image, future board states in a chess game etc.). There can be any number of hidden layers in an ANN but it is usually best to use the minimum number possible.<\/p><p>The neurons are linked together between different layers (typically they are not linked within layers) by the edges mentioned earlier. These edges determine how the activation value or signal strength output by neurons in previous layers influences the activation value of the neurons in the next layer. The overall aim of all these connections being the hope that a given set of input neurons firing\u00a0 will be connected with the correct output in the final layer. This is achieved by changing parameters associated with each edge known as weights that specify how strongly the activation value of a neuron affects that of another. In the gif, the edges are thicker if they have a large weight. The activation value of a given neuron is\u00a0 given by a function that takes in the activation values of all of the neurons in the previous layer along with the weights associated with the edges linking those neurons to the current neuron. The function also contains a term known as bias that essentially acts as a threshold ensuring that neurons are only activated if they have received a strong enough signal. The function is of a form such that it takes the signals, weights and bias, and converts them into a number between zero and one which is then the activation value.\u00a0<\/p><p>For an ANN to work correctly, it is important that the weights and biases are set correctly. The process of determining the correct weights and biases is called training. I will not go into training in detail here because this post is already getting quite long but in brief, it consists of using a large amount of data and specialised techniques that compare what the network is outputting for a given input with what is expected and adjusting the parameters intelligently such that the output moves closer to what is expected.<\/p><p>In conclusion, the way to think of a neural network is like a black-box function that takes an input and gives an output according to parameters which are the weights and biases. What is happening in the black box is what is happening in the hidden layers of the neural network which identify important features of the input to determine the output. The black box will only give the correct outputs for a given input if the values of the parameters are correct which is what is accomplished by training the neural network. This may seem a bit like magic but the training is based on fairly simple mathematical concepts that essentially make sure that the output matches the expected output as well as possible on average. It turns out that neural networks perform outstandingly well and can identify the correct output pretty much all the time.<\/p><p><span style=\"font-size: 16px\">This post might have seemed a bit of a strange one to include on a statistics and Operational research blog but looking beneath the surface it isn&#8217;t. As it turns out many of the techniques in machine learning were originally conceived to solve problems in statistics and mathematical optimization. Not to mention how machine learning looks to be a very promising tool for solving future problems in statistics and OR.<\/span><\/p><p style=\"font-size: 16px;font-style: normal;font-weight: 400\"><span style=\"font-size: 16px;font-weight: bold\">Relevant links<\/span><\/p><p style=\"font-size: 16px;font-style: normal;font-weight: 400\"><a href=\"https:\/\/www.nature.com\/articles\/nature16961?MRK_CMPG_SOURCE=sm_tw_pp\" target=\"_blank\" rel=\"noopener\">David Silver &amp; Deepmind&#8217;s paper on alphaGo<\/a><\/p><p style=\"font-size: 16px;font-style: normal;font-weight: 400\"><a href=\"http:\/\/neuralnetworksanddeeplearning.com\/\">Michael Nielsen&#8217;s excellent free book<\/a><\/p><p style=\"font-size: 16px;font-style: normal;font-weight: 400\"><a href=\"https:\/\/www.youtube.com\/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi\">A brilliant video playlist that introduces Neural Networks and touches on training of neural networks<\/a><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>How studying the brain is helping to build &#8220;brains&#8221;. Unless you&#8217;ve been living under a rock for the last few years, you&#8217;ve probably heard of the terms machine learning and neural networks. Maybe you saw the media frenzy surrounding the Go match between GOAT Lee Sedol and the computer program alphaGo (If not, I recommend [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":985,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"slim_seo":{"title":"Artificial Neural Networks - JACK TRAINER","description":"How studying the brain is helping to build \"brains\". Unless you've been living under a rock for the last few years, you've probably heard of the terms machine l"},"footnotes":""},"categories":[13,11],"tags":[15,16],"class_list":["post-956","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-learning","category-stats","tag-anns","tag-machine-learning"],"_links":{"self":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":24,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/posts\/956\/revisions"}],"predecessor-version":[{"id":1006,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/posts\/956\/revisions\/1006"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/media\/985"}],"wp:attachment":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/media?parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/jack-trainer\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}