Create Your First Artificial Neuron

Author(s: Satya Ganesh Learn, implement, and visualize Artificial Neurons using Python. In the year 1943,, Warren McCulloch & Walter Pitts proposed artificial neurons. It is a simplified computational model that resembles the behavior of neurons from the human brain. Let’s take a closer look at artificial neurons before we get into more details about them. Image source: Wikipedia Biological Neuron A biological neuron is a unit that receives inputs through dendrites. It then sends these signals to the soma, or cell body. The processed signal is carried to other neurons via the axon. A synapse is the junction between two neurons. The strength of the signal transmitted to the other neurons depends on the degree of the synapse. McCulloch Pitts Neuron (MP Neuron). The Threshold logic unit (TLU) or Linear Threshold Unit is an artificial neuron. It is called this because its output value is dependent on the threshold value. This artificial neuron is inspired by the workings of a natural neuron. It’s designed to be similar to biological neurons. Image by Author. Input Vector [x₁ x₂ x₃…xₙ]. — An Artificial neuron uses the input vector to act as inputs. It behaves similarly to Biological Neuron’s dendrites. Function f (x) — An Artificial neuron’s function f(x), which is a summation, behaves similarly to soma within Biological neurons. A. Model of MP Neuron. The Model can be described as an approximate function of the relationship between dependent and independent variables. [x₁ x₂ x₃ … xₙ] — attributes or inputs to the MP Neuron Model. Threshold values, which are the sole parameter of the MP Neuron Model. Function g (x) summarises all inputs. The function function f(x), on the other hand, applies a threshold to the output of function g (x). Function f(x), which returns a value that can be used to activate the neuron, is a boolean value. If the summation exceeds the threshold (b), then the neuron will get activated. Otherwise, the neuron will fire. MP Neuron: There are only binary data required, and that input vector is X. The neuron performs binary classification, ie Y. A Geometrical Interpretation for MP Neuron To tune the model, we must change the y-intercept (c=b) All points located on the top of the line can be classified as positive (1), while all points below it are considered negative(0). When we plot the line, x2 = +x1 + 1 photo by the author Summary: All points above the line are considered positive (green). Negative points are those below it (red points). The MP Neuron model only works if the points can be separated linearly. MP Neuron models have a slope that equals -1. The power is available to alter the value of the y-intercept (b). B. B. C. Optimization Algorithm, since b is the sole parameter of the model, it is necessary to select the value that reduces the loss. The range of b values is [0,n],, where n represents the number of features. We can use brute force to choose the value of b. When x1+ x2+x3…xn=0 is the minimum value, that is, when the feature vector looks like [x₁ x₂ x₃ … xₙ]= [0 0 0 …0], then b will take the maximum value when x1+ x2+x3…xn =n. If the value of B lies between [0,n], and [1 1 1 … 1], we can calculate the loss each model has incurred and choose the most effective one. D. Evaluation We can use this formula to evaluate the model’s performance. The MP Neuron Model only accepts data in the form of “0,1” and cannot be fed with actual values. This model is used only for binary classification. This algorithm works best when the data are linearly separated. The slope of the line equation is fixed, and it cannot be changed. It is impossible to determine which feature should be prioritized and can’t even decide which one is the most important. We are using brute force to determine the threshold value. The learning algorithm we used isn’t very impressive. Let’s code… data requirements. We use the sklearn breast cancer dataset and we must predict whether the person will develop cancer based upon the information provided. Importing essential library B. Loading data C. Visualizing data image by the author (output from above code snippet). The above plot shows that the data we use is in binary format. However, the MP Neuron model demands that the data be binary. Let’s now convert these data to binary. Before we can convert this data to binary, it is necessary to divide the data into test and train data. Image by the Author (data after binning). F. Definiting the MP Neuron G. The model’s performance is 84.6% on training data. Let us now see the model’s performance for various values of b. performance on test data. This article was a great learning experience. Refer to Wikipedia NPTEL Course on Deep Learning. Thanks for reading. Have a great day!

THE FOREFRONT OF TECHNOLOGY

We monitors and writes about new technologies in areas such as technology, innovation, digitization, space, Earth, IT and AI.

Related Posts

Leave a Reply