Python Encyclopedia for Academics
  • Course Outline
  • Artificial Intelligence
    • Data Science Foundation
      • Python Programming
        • Introduction and Basics
          • Variables
          • Print Function
          • Input From User
          • Data Types
          • Type Conversion
        • Operators
          • Arithmetic Operators
          • Relational Operators
          • Bitwise Operators
          • Logical Operators
          • Assignment Operators
          • Compound Operators
          • Membership Operators
          • Identity Operators
      • Numpy
        • Vectors, Matrix
        • Operations on Matrix
        • Mean, Variance, and Standard Deviation
        • Reshaping Arrays
        • Transpose and Determinant of Matrix
      • Pandas
        • Series and DataFrames
        • Slicing, Rows, and Columns
        • Operations on DataFrames
        • Different wayes to creat DataFrame
        • Read, Write Operations with CSV files
      • Matplotlib
        • Graph Basics
        • Format Strings in Plots
        • Label Parameters, Legend
        • Bar Chart, Pie Chart, Histogram, and Scatter Plot
  • Machine Learning Algorithms
    • Regression Analysis In ML
      • Regression Analysis in Machine Learning
      • Proof of Linear Regression Formulas
      • Simple Linear Regression Implementation
      • Multiple Linear Regression
      • Advertising Dataset Example
      • Bike Sharing Dataset
      • Wine Quality Dataset
      • Auto MPG Dataset
    • Classification Algorithms in ML
      • Proof of Logistic Regression
      • Simplified Mathematical Proof of SVM
      • Iris Dataset
  • Machine Learning Laboratory
    • Lab 1: Titanic Dataset
      • Predicting Survival on the Titanic with Machine Learning
    • Lab 2: Dow Jones Index Dataset
      • Dow Jones Index Predictions Using Machine Learning
    • Lab 3: Diabetes Dataset
      • Numpy
      • Pandas
      • Matplotlib
      • Simple Linear Regression
      • Simple Non-linear Regression
      • Performance Matrix
      • Preprocessing
      • Naive Bayes Classification
      • K-Nearest Neighbors (KNN) Classification
      • Decision Tree & Random Forest
      • SVM Classifier
      • Logistic Regression
      • Artificial Neural Network
      • K means Clustering
    • Lab 4: MAGIC Gamma Telescope Dataset
      • Classification in ML-MAGIC Gamma Telescope Dataset
    • Lab 5: Seoul Bike Sharing Demand Dataset
      • Regression in ML-Seoul Bike Sharing Demand Dataset
    • Lab 6: Medical Cost Personal Datasets
      • Predict Insurance Costs with Linear Regression in Python
    • Lab 6: Predict The S&P 500 Index With Machine Learning And Python
      • Predict The S&P 500 Index With Machine Learning And Python
  • Artificial Neural Networks
    • Biological Inspiration vs. Artificial Neurons
    • Review linear algebra and calculus essentials for ANNs
    • Activation Function
  • Mathematics
    • Pre-Calculus
      • Factorials
      • Roots of Polynomials
      • Complex Numbers
      • Polar Coordinates
      • Graph of a Function
    • Calculus 1
      • Limit of a Function
      • Derivative of Function
      • Critical Points
      • Indefinite Integrals
  • Calculus 2
    • 3D Coordinates and Vectors
    • Vectors and Vector Operations
    • Lines and Planes in Space (3D)
    • Partial Derivatives
    • Optimization Problems (Maxima/Minima) in Multivariable Functions
    • Gradient Vectors
  • Engineering Mathematics
    • Laplace Transform
  • Electrical & electronics Eng
    • Resistor
      • Series Resistors
      • Parallel Resistors
    • Nodal Analysis
      • Example 1
      • Example 2
    • Transient State
      • RC Circuit Equations in the s-Domain
      • RL Circuit Equations in the s-Domain
      • LC Circuit Equations in the s-Domain
      • Series RLC Circuit with DC Source
  • Computer Networking
    • Fundamental
      • IPv4 Addressing
      • Network Diagnostics
  • Cybersecurity
    • Classical Ciphers
      • Caesar Cipher
      • Affine Cipher
      • Atbash Cipher
      • Vigenère Cipher
      • Gronsfeld Cipher
      • Alberti Cipher
      • Hill Cipher
Powered by GitBook
On this page
  • Objective:
  • 1. Biological Neurons: The Brain’s Building Blocks
  • 2. Artificial Neurons: Mathematical Models
  • 3. Python Simulation: A Simple Artificial Neuron
  • 4. Key Differences & Limitations
  • Keywords
  1. Artificial Neural Networks

Biological Inspiration vs. Artificial Neurons

Nerd Cafe

PreviousArtificial Neural NetworksNextReview linear algebra and calculus essentials for ANNs

Last updated 1 month ago

Objective:

Understand how biological neurons inspired artificial neural networks (ANNs) and compare their structures and functions.

1. Biological Neurons: The Brain’s Building Blocks

Structure of a Biological Neuron

A neuron consists of:

  1. Dendrites: Receive signals from other neurons.

  2. Cell Body (Soma): Processes incoming signals.

  3. Axon: Transmits signals to other neurons.

  4. Synapses: Connections between neurons where chemical signals (neurotransmitters) are exchanged.

How Biological Neurons Work

  • Input (Dendrites): Receives electrical impulses.

  • Processing (Soma): Sums inputs; if the signal exceeds a threshold, the neuron "fires."

  • Output (Axon): Sends signals to connected neurons.

Key Properties:

  • Non-linear activation: Neurons don’t fire linearly—they have thresholds.

  • Plasticity: Synapses strengthen/weaken based on activity (learning).

2. Artificial Neurons: Mathematical Models

McCulloch-Pitts Neuron (1943)

  • The first computational model of a neuron.

  • Binary output: Fires (1) if input exceeds threshold, else (0).

Mathematical Model:

Output={1if ∑iwipi+b≥00otherwise\text{Output} = \begin{cases} 1 & \text{if } \sum_i w_i p_i + b \geq 0 \\ 0 & \text{otherwise} \end{cases}Output={10​if ∑i​wi​pi​+b≥0otherwise​
  • pi​ = Input signals

  • wi​ = Weights (synaptic strength)

  • b = Bias (threshold adjustment)

Modern Artificial Neurons

  • Activation Functions: Replace step function with smooth alternatives (sigmoid, ReLU).

  • Learning: Adjust weights via backpropagation (inspired by synaptic plasticity).

Biological Neuron
Artificial Neuron

Dendrites receive signals

Input layer ( pi​ )

Synaptic strength varies

Weights ( wi)

Soma sums inputs

Weighted sum ( ∑ wi p i + b)

Fires if threshold met

Activation function (e.g., ReLU)

3. Python Simulation: A Simple Artificial Neuron

Let’s implement a McCulloch-Pitts neuron in Python.

Code Example

import numpy as np

def artificial_neuron(inputs, weights, bias):
    weighted_sum = np.dot(inputs, weights) + bias
    return 1 if weighted_sum >= 0 else 0

# Example: AND Gate
inputs = np.array([[0, 0], [0, 1], [1, 0], [1, 1]])
weights = np.array([1, 1])  # Adjust weights for different logic gates
bias = -1.5  # Threshold

for x in inputs:
    output = artificial_neuron(x, weights, bias)
    print(f"Input: {x}, Output: {output}")

Output

Input: [0 0], Output: 0
Input: [0 1], Output: 0
Input: [1 0], Output: 0
Input: [1 1], Output: 1

4. Key Differences & Limitations

Aspect
Biological Neuron
Artificial Neuron

Processing

Parallel, energy-efficient

Sequential, computationally heavy

Learning

Dynamic, self-organizing

Requires explicit training (e.g., backpropagation)

Robustness

Fault-tolerant (damaged neurons adapt)

Sensitive to architecture/initialization

Keywords

neuron, activation function, weights, bias, perceptron, backpropagation, gradient descent, loss function, hidden layers, ReLU, sigmoid, feedforward, optimization, training set, validation, overfitting, regularization, dropout, CNN, RNN, LSTM, nerd cafe