🧠 ANN Example: Student Result Prediction
Predict whether a student is likely to PASS or FAIL using Attendance, Study Hours and Previous Exam Score.
1. What is an Artificial Neural Network?
An Artificial Neural Network (ANN) is a computational model that learns relationships between input data and an output.
In this example, the ANN receives three inputs:
Attendance Study Hours Previous ScoreThe network processes these inputs through neurons and calculates the probability that the student will pass the examination.
The weights and values used below are simplified so that students can understand the ANN calculations manually.
2. Student Data
| Input Feature | Actual Value | Normalized Value |
|---|---|---|
| Attendance | 80% | 0.80 |
| Study Hours | 6 hours/day | 0.60 |
| Previous Exam Score | 70% | 0.70 |
Therefore the ANN receives:
X₂ = 0.60
X₃ = 0.70
3. ANN Architecture
X₁ = 0.80
X₂ = 0.60
X₃ = 0.70
Probability
The information travels from the input layer through the hidden layer to the output layer.
4. Step-by-Step Mathematical Calculation
Click the buttons below to reveal each calculation.
1 Identify the Input Values
The three normalized inputs are:
X₂ = Study Hours = 0.60
X₃ = Previous Score = 0.70
These inputs are passed to the neurons in the hidden layer.
2 Assign Weights and Bias
Suppose hidden neuron H₁ has learned the following parameters:
W₂ = 0.30
W₃ = 0.30
Bias = 0.10
The weights represent the importance of each input for this particular neuron.
3 Calculate the Weighted Sum
The neuron uses the equation:
Substitute the values:
Calculate each multiplication:
0.60 × 0.30 = 0.18
0.70 × 0.30 = 0.21
Add everything:
Z = 0.81
Therefore: Weighted Sum = 0.81
4 Apply Sigmoid Activation
The sigmoid activation function is:
We have:
Substitute:
Approximately:
H₁ ≈ 1 / (1 + 0.445)
H₁ ≈ 0.692
Therefore the hidden neuron produces: H₁ ≈ 0.692.
5 Calculate the Output
Suppose the output neuron has:
Output Bias = -0.50
First calculate the output weighted sum:
Substitute:
Calculate:
Zout = 0.9688 - 0.50
Zout = 0.4688
Apply sigmoid:
P(Pass) ≈ 0.615
6 Make the Final Prediction
Suppose the classification threshold is:
The ANN predicted:
Compare the probability with the threshold:
5. Complete Mathematical Flow
↓
Attendance = 0.80
Study Hours = 0.60
Previous Score = 0.70
↓
WEIGHTED SUM
Z = (0.80 × 0.40) + (0.60 × 0.30) + (0.70 × 0.30) + 0.10
Z = 0.81
↓
SIGMOID ACTIVATION
H₁ ≈ 0.692
↓
OUTPUT
Zout = (0.692 × 1.40) - 0.50
Zout = 0.4688
↓
FINAL SIGMOID
P(Pass) ≈ 0.615
↓
61.5% → PASS
6. ANN Terms Used in This Example
Input Layer Hidden Layer Output Layer Neuron Weight Bias Weighted Sum Activation Function Sigmoid Probability ThresholdImportant concept: The ANN combines several inputs instead of relying on only one factor. Each input is multiplied by a learned weight, the bias is added, and the activation function transforms the result before the final prediction is produced.
No comments:
Post a Comment