Artificial Intelligence Lecture Notes: Fundamentals of Artificial Neural Networks
Biological Inspiration and the Human Brain
Foundational Concept: Artificial Neural Networks (ANN) are computational models inspired by the neurological model of the human brain.
Brain vs. Computer (Von Neumann Machine):
Classical Computer: Follows the Von Neumann machine design (the basic design of modern computers).
Human Brain: Operates differently; it is highly complex, nonlinear, and capable of parallel computing.
Speed: The brain can be many times faster than a computer for specific tasks.
Rules and Experience: The brain has a structure that allows it to build its own rules based on experience.
Developmental Plasticity:
Dramatic development occurs within the first two years after birth.
Development continues throughout life.
Plasticity is defined as the ability of the brain to adapt to its environment.
Why Artificial Neural Networks are Necessary
Human Effortlessness vs. Computer Difficulty: Certain tasks are easy for humans but difficult for conventional paradigms using an algorithmic approach on a Von Neumann machine.
Typical Domains for ANN:
Pattern Recognition: Recognizing old friends or hand-written characters.
Content Addressable Recall: Accessing memories based on content.
Approximate and Common-sense Reasoning: Examples include driving, playing the piano, or being a baseball player.
Task Attributes: These tasks are often ill-defined, experience-based, and hard to express through strict logic.
Biological Neural Activity and Anatomy
Neuron Structure:
Body (Soma): The central part of the neuron.
Axon: The long thread-like part that conducts impulses away from the cell body.
Dendrites: Branched extensions that receive stimuli.
Neuron States: A neuron can be in one of two states: firing or at rest.
The Firing Principle: A neuron fires if the total incoming stimulus exceeds a specific threshold.
Synapse:
The thin gap between the axon of one neuron and the dendrite of another.
Facilitates signal exchange.
Possesses "synaptic strength" or efficiency, which changes during learning.
Mapping Biological Neurons to Artificial Neurons
Dendrites correspond to Input ().
Synapse corresponds to Weights ().
Soma corresponds to the Processing unit (Summation and Activation).
Axon corresponds to the Output signal stage.
Terminal Branches of Axon correspond to the transmission of the output to the next neuron.
Operational Logic: Artificial neurons process information received in the form of "spikes" (signals).
Areas for Practical Application of Neural Networks
General Functional Areas:
Pattern association and classification.
Regularity detection and optimization problems.
Image processing and speech analysis.
Robot steering.
Processing inaccurate or incomplete inputs.
Stock market forecasting and simulation.
Sector-Specific Applications:
Marketing: Consumer spending pattern classification and sales forecasting.
Defense: Radar and sonar image classification; target tracking.
Agriculture and Fishing: Fruit and catch grading; crop yield forecasting.
Medicine: Ultrasound and electrocardiogram (ECG) classification; EEGs; medical diagnosis.
Finance: Signature and bank note verification; foreign exchange and stock market forecasting.
Security: Motion detection, surveillance image analysis, and fingerprint matching.
Engineering: Product inspection, monitoring, and control.
Meteorology: Weather prediction.
Noteworthy Examples:
Pattern Classifier: Distinguishing between digits ( to ), even when digits are corrupted by noise.
Face Detection: Neural network-based face detection (referenced to PAMI vol. 20(1), 1998).
Fundamentals of NN: The Learning Process
Learning by Adaptation: In biological systems, learning involves physical changes at the neural level.
Example: An animal learns that green fruits are sour while red/yellow ones are sweet, adapting its picking behavior accordingly.
Neural Mechanism: Biological learning occurs by changing synaptic strengths, eliminating old synapses, and building new ones.
Learning as Optimization: Biological organisms adapt responses to achieve a closer-to-optimal state (e.g., maximizing energy intake and happiness).
Energy Minimization in ANN:
In artificial systems, we use mathematical optimization to change synaptic weights.
Energy in this context is defined as a measure of task performance error.
Key Elements of ANN: Typical Architecture
Layered Arrangement: Neurons are organized into layers.
Layer 0 (Input Layer): Nodes serve as placeholders for environment inputs. No computation occurs here; the node function is the identity function.
Hidden Layer(s): Intermediate layers between input and output. They are "hidden" because they are not directly visible to the external environment. They extract higher-order statistics and features.
Output Layer: Produces the final result.
Network Architectures:
Single Layer Net: Contains one layer of connection weights. Signals flow forward (feed-forward) from inputs to outputs.
Multiple Layer Net: Contains one or more hidden layers. Successive hidden layers represent higher-level features based on previous layers.
Feed-Forward Networks: Signals flow strictly in one direction (input to output).
Recurrent Networks: Distinguished from feed-forward by having at least one feedback loop. These can exist with or without hidden units and often involve a Unit delay operator.
Mathematical Model of a Neuron:
The activation is calculated as:
Where are inputs, are weights, and is the bias.
Key Elements of ANN: Weights and Bias
Weights ():
Initial weights are typically chosen randomly between and (or to ).
Fixed Networks: Weights do not change.
Adaptive Networks: Weights are updated to reduce error.
Bias ():
An "extra" neuron added to layers that always stores the value of .
It has no incoming connections and is not connected to previous layers.
Purpose: It allows the classifier to shift or translate the decision boundary left or right. Without it, a perceptron cannot learn the ideal decision boundary if it doesn't pass through the origin or require translation.
Positive Bias: Increases net input.
Negative Bias: Decreases net input.
Key Elements of ANN: Activation Functions
Purpose: Activation functions introduce nonlinearity. Without nonlinearity, multiple layers would be no more powerful than a single layer because a linear function of linear functions is always linear.
Types of Functions ():
Step Function (Threshold Function):
Mirrors biological firing (either fires or not).
Sign Function:
Sigmoid Function:
Generally ranges between and .
Produces an 'S'-shaped curve and is differentiable.
Variation: Hyperbolic tangent function ( to range).
Linear Function:
Piecewise-Linear Function:
Can take values of or , but also values in between based on an amplification factor in the linear region.
Example Calculations and Weight Updating
Single Layer Calculation Example:
Given four inputs and weights resulting in a pre-activation output () of .
Resulting outputs:
Step:
Sign:
Sigmoid:
Linear:
Multiple Layer Calculation (Sigmoid Example):
Input layer () processing weights to Hidden Layers.
Hidden layer output calculation: where .
Final output .
Supervised Weight Updating Formula:
represents the learning rate.
Numerical Example (Slide 48):
Inputs: with weights .
Sum: .
Assume Threshold = . Output is calculated as if sum , else .
Actual Output = . Desired Output = . .
Discussion Case (Threshold with Bias):
Weights: HS = , MTM = . Threshold = . Bias = .
ID2 Inputs (): .
Output is because .
Updated weights based on example: HS = , MTM = .
Re-calculation with new weights: .
Output is because .