Total Pageviews

Monday, August 31, 2026

🧠 ANN Example: Student Result Prediction

🧠 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 Score

The network processes these inputs through neurons and calculates the probability that the student will pass the examination.

Educational Example:

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.80
X₂ = 0.60
X₃ = 0.70

3. ANN Architecture

INPUT LAYER
Attendance
X₁ = 0.80
Study Hours
X₂ = 0.60
Previous Score
X₃ = 0.70
OUTPUT LAYER
Pass
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₁ = Attendance = 0.80
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.40
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:

Z = X₁W₁ + X₂W₂ + X₃W₃ + b

Substitute the values:

Z = (0.80 × 0.40) + (0.60 × 0.30) + (0.70 × 0.30) + 0.10

Calculate each multiplication:

0.80 × 0.40 = 0.32
0.60 × 0.30 = 0.18
0.70 × 0.30 = 0.21

Add everything:

Z = 0.32 + 0.18 + 0.21 + 0.10

Z = 0.81

Therefore: Weighted Sum = 0.81

4 Apply Sigmoid Activation

The sigmoid activation function is:

Sigmoid(z) = 1 / (1 + e-z)

We have:

Z = 0.81

Substitute:

H₁ = 1 / (1 + e-0.81)

Approximately:

e-0.81 ≈ 0.445

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 Weight = 1.40
Output Bias = -0.50

First calculate the output weighted sum:

Zout = (H₁ × Output Weight) + Output Bias

Substitute:

Zout = (0.692 × 1.40) - 0.50

Calculate:

0.692 × 1.40 = 0.9688

Zout = 0.9688 - 0.50

Zout = 0.4688

Apply sigmoid:

P(Pass) = 1 / (1 + e-0.4688)

P(Pass) ≈ 0.615
Pass Probability ≈ 61.5%

6 Make the Final Prediction

Suppose the classification threshold is:

Threshold = 50%

The ANN predicted:

Probability = 61.5%

Compare the probability with the threshold:

61.5% ≥ 50%
🎓 PREDICTION: STUDENT WILL PASS

5. Complete Mathematical Flow

INPUT

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 Threshold

Important 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