Total Pageviews

Monday, August 31, 2026

🧠 ANN Example: Loan Approval Prediction

🧠 ANN Example: Loan Approval Prediction

Learn how an Artificial Neural Network can use Age, Monthly Income and Repayment History to predict whether a loan should be approved.

1. What is an Artificial Neural Network?

An Artificial Neural Network (ANN) is a machine-learning model made up of interconnected processing units called neurons.

The neurons receive input data, multiply the inputs by their corresponding weights, add a bias, and pass the result through an activation function.

In this example, the ANN will predict:

Loan Approved Loan Rejected

The example is designed for learning ANN mathematics. A real lending system would require many more variables, properly trained parameters, validation, and appropriate regulatory controls.

2. Example Applicant Data

Feature Original Value Normalized Value
Age 35 years 0.35
Monthly Income ₹70,000 0.70
Repayment History 90% 0.90
Why normalization?

ANN calculations work better when input values are placed on a comparable numerical scale.

For this simple example we will use:

Age = 0.35
Income = 0.70
Repayment History = 0.90

3. ANN Structure

INPUT LAYER
Age
X₁ = 0.35
Income
X₂ = 0.70
Repayment
X₃ = 0.90
OUTPUT LAYER
Loan
Probability

The information moves from the input layer to the hidden layer and finally to the output layer.

4. Step-by-Step ANN Mathematics

Click each button to understand the calculation one step at a time.

1 Identify the Inputs

Our ANN receives three inputs.

X₁ = Age = 0.35
X₂ = Monthly Income = 0.70
X₃ = Repayment History = 0.90

These values are sent to the neurons in the hidden layer.

2 Assign Weights and Bias

Suppose the trained ANN has learned the following simplified parameters for hidden neuron H₁:

W₁ = 0.20
W₂ = 0.50
W₃ = 0.30
Bias = 0.10

The weights determine how strongly each input contributes to the neuron.

Here, income has a larger weight than age, meaning income has a greater influence on this particular simplified neuron.

3 Calculate the Weighted Sum

The basic neuron equation is:

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

Substitute the values:

Z = (0.35 × 0.20) + (0.70 × 0.50) + (0.90 × 0.30) + 0.10

Calculate each multiplication:

0.35 × 0.20 = 0.070
0.70 × 0.50 = 0.350
0.90 × 0.30 = 0.270

Now add all the values:

Z = 0.070 + 0.350 + 0.270 + 0.100

Z = 0.790

Therefore, the weighted sum received by H₁ is: 0.790.

4 Apply the Sigmoid Activation Function

The sigmoid function converts the weighted sum into a value between 0 and 1.

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

We obtained:

Z = 0.790

Substitute the value:

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

Approximately:

e-0.790 ≈ 0.454

H₁ ≈ 1 / (1 + 0.454)

H₁ ≈ 0.688

Therefore: H₁ ≈ 0.688

5 Calculate the Output

Suppose the output neuron uses:

Output Weight = 1.30
Output Bias = -0.40

The output weighted sum is:

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

Substitute:

Zout = (0.688 × 1.30) - 0.40

Calculate:

0.688 × 1.30 = 0.8944

Zout = 0.8944 - 0.40

Zout = 0.4944

Now apply sigmoid to the output.

P(Loan Approval) = 1 / (1 + e-0.4944)

P(Loan Approval) ≈ 0.621
Loan Approval Probability ≈ 62.1%

6 Make the Final Decision

Suppose the decision threshold is 50%.

Probability = 62.1%
Threshold = 50%

62.1% ≥ 50%

Since the predicted probability is greater than the threshold, the simplified ANN classification is:

✅ PREDICTION: LOAN APPROVED

5. Complete ANN Mathematical Flow

INPUT

Age = 0.35
Income = 0.70
Repayment History = 0.90


WEIGHTED SUM
Z = (0.35 × 0.20) + (0.70 × 0.50) + (0.90 × 0.30) + 0.10
Z = 0.790


SIGMOID
H₁ ≈ 0.688


OUTPUT WEIGHTED SUM
Zout = (0.688 × 1.30) - 0.40
Zout = 0.4944


FINAL SIGMOID
P ≈ 0.621


62.1% → LOAN APPROVED

6. Important ANN Terms Used

Input Neuron Weight Bias Weighted Sum Hidden Layer Output Layer Activation Function Sigmoid Probability Threshold

Remember: The ANN does not simply compare one value with a fixed rule. It combines multiple inputs using learned weights and biases and then uses an activation function to produce the prediction.

No comments:

Post a Comment