Comparative Risk Factor Analysis in Loan Risk Prediction
Using Variable Artificial Neural Network Layer
Configuration
Md. Rezaul Hossain
and Fizar Ahmed
*
Department of Computer Science and Engineering, Daffodil International University, Dhaka, 1216, Bangladesh
*Email: fizar.cse@diu.edu.bd (F. Ahmed)
Abstract
Loans have become an inevitable part of the con- temporary financial market and thus predicting the risk inherent in
a particular loan is crucial in avoiding high levels of default and improving on the profitability of the loans. The study
fills the current research gap concerning creating and fine-tuning loan risk prediction models by comparing the
performance of different Artificial Neural Network (ANN) layers (4-layer, 5-layer, and 6-layer) in identifying the risk
attributes in loan defaults. This paper utilizes a comparative research design, using diverse borrower attributes and a
range of financial ratios. Specifically, the method like Accuracy, Precision, Recalling is used to assess how well every
configuration of ANN works on loan risk prediction. Fortnight preliminary results do suggest that 6-layer ANN provides
much higher accuracy and recall rates than 4, 5-layer ANN neural networks. The contribution of these results is in the
development of more profound and distinct knowledge of financial analytics, along with the possibilities of the two-
tiered neural network structures for improving loan risk assessment. Additionally, the results of the study throw the
light on the choice of the right risk factors and configurations for the ANN for the practical problems of credit scoring
in the financial institutions, and opens up the directions for future research that can enhance the performance of the
predictive modeling for credit risk assessment.
Keywords: Machine learning; Artificial Neural Network; Loan identification; Loan risk analysis.
1. Introduction
Credit risk management has proved to occupy a central position in financial institutions, particularly in the
contemporary world financial scene. A particularly important process that forms the basis of credit risk management
is the prediction of loan risk, which will allow the bank to determine the probability of attracting loan losses. In the
past, loan risk assessment has to some extent been based on statistical and rule- based models that do not accurately
take into consideration the many interactions between or within loans and borrowers. Machine learning and the
Artificial Neural Networks (ANN) specifically, have enhanced and developed superior sources of risk prediction. The
solution became more accurate and malleable at the hands of ANN.
[1]
Artificial neural networks are one of the powerful computational models derived on the basis of the structure of the
human brain. It is also noticeable that they are good at modal recognition therefore making them suitable for
categorization problems like loan risk assessment. ANNs are a set of layers of complex nodes/ neurons that can learn
from data using backpropagation and gradient descent. ANN structure mainly the quantity of the secret layers and the
neurons in each of them have a greater impact on the predictive capability of the developed model. Nonetheless,
choosing the appropriate network architecture is still a problem, higher levels may provide additional learning
capability but are inclined to overfit.
[2]
Therefore, the objective of this thesis is to establish an understanding of how
the number of secret (hidden) layers influences the performance of loan risk prediction on ANN. In particular, we will
measure the performance difference of 4-layer, 5-layer, and 6-layer of the neural network in order to determine
loan defaults. In the following analysis, we aim to determine which configuration of ANN is suitable for this
task, using metrics such as network depth and the resulting accuracy, precision, recall, etc. Furthermore, factors that
include credit history, income, and employment status of the borrowers, and their effect on each of the models will
also be discussed in this study.
Based on it, the major contribution of this research will be to advance the current efforts in advancing the loan risk
predictor models and to assist the financial institutions to manage creditworthiness and loan default risks.
1.1 Literature review
Risk assessment on loans has always been a major concern in the field of banking and finance for many years with
many papers directed toward enhancing the accuracy of the models utilizing statistical methodology alongside artificial
neural networks and other intelligent methodologies. This section discusses a historical perspective of loan risk
prediction models with ANNs and various architectures discussion.
Speaking of the methods applied earlier for loan risk prediction, it is possible to mention logistic regression, decision
trees, and discriminant analysis. According to Thomas et al. (2002), logistic regression was appropriate in this study
because it is simple and easily interpretable.
[3]
These models presume the straight-line relationship between borrower characteristics and loan performance, while
the actual data can be different. It was Altman’s Z-score (1968) model, used for corporate bankruptcy prediction,
that provided groundwork for credit risk evaluation. However, traditional models are applied to discrete variables as
linear and independent; therefore, they cannot help much when analyzing interdependent and nonlinear data of
financial fields.
[4]
By the help of evolved machine learning, random forests, decision trees, gradient boosting machines (GBMs) and,
support vector machines (SVMs) were commonly used in predictive modeling. Malhotra and Malhotra (2003) and
Lessmann et al. (2015) established that self-regulating algorithms offered superior performance to conventional
methods in dealing with vast databases that include complicated feature interactions.
[5,6]
But deep learning has opened
up new ways in dealing with non-linear relationship of loan risks prediction. Kou et al. (2021) offered an extensive
analysis; they showed how, despite the numerous choices available, deep learning models, and ANNs predominantly,
efficiently identify even subtle relationships in the financial data. Unlike conventional approaches, these models
do not entail feature engineering often needed for popular algorithms and can learn from data directly through multiple
transformations.
[7]
Because of the non-linear mapping capability of ANN, between the input and target variable, the application of ANNs
has shown promising results in loan risk prediction. Zhang and Kanda (2017) employed a simple feedforward ANN
for credit defaults with only one hidden layer including better accurate predicting as compared to logistic regression
models. But as they pointed out, they realized how delicate the model performance might be with network architecture
concerning the number of hidden nodes and layers.
[8]
In their study, Heaton et al. (2016) showed that Deep ANNs
are capable of analyzing a large volume of values making them appropriate for analytical use in the financial sector.
But the study also highlighted some of the disadvantages which include over fitting especially with deeper networks
architectures.
[9]
Goodfellow et al., (2016) reiterated the argument of depth when addressing the effectiveness of the
network stating that while deeper networks provide better solutions, they will also lead to greater chances of overfitting
and could be very computation intensive.
[10]
ANN is ideally best suited and the overall count of hidden layers and neural units has been a subject to extensive
research. Another downside of deeper networks for Hinton et al. (2006) and LeCun et al. (2015) these models enable
sophisticated performances to be learned due to their efficiency but are computationally intensive and more sensitive
to overfitting if training data is scarce.
[11,12]
Peng, Kou and Zhou (2018) discuss how the magnitude of the network’s
depth affects the risk prediction models in insurance. They also discovered that deep learning systems with more
hidden layers fared better than the shallow ones, though more care had to be taken to avoid overfitting than
through regularization techniques including dropout and batch normalization. Another work by Chaudhary et al.
(2020) focused on the impacts of different layer ANNs on the credit scoring and discovered rising the depth of the
network helped enhancing the precision of the model but added extra training difficulty.
[13,14]
The literature review also attests to the point of feature selection and the study of effects of different risk factors.
In their study on credit scoring using logistic regression T. Hastie, R Tibshiran, and J Friedman (2009) found predictors
including credit history, income, and employment. The findings have revealed that these risk factors are significant
and are persistent contributing factors to loan default predictions.
[15]
Subsequently, Kou et al. (2018) further developed
this by using deep learning methods to investigate the effect of the aforementioned risk factors in non-linear models.
They found out that deep ANNs contain the ability to reveal the behavior between borrower characteristics and
default rates undetectable by conventional models.
[7]
Various variants of ANNs have been assessed in several comparative researches to determine their impact on model
performance. Yu et al. (2018) worked on the comparison of shallow and deep ANNs for loan default prediction
and discovered that the loan default predicting power of deeper networks is superior as well as is the generalizing
power especially when training data overabundance is present. They however pointed out that with the increased
employment of deep architectures, there were larger computational costs and that it required more optimum
techniques and ideas.
[16]
Predicting mortgage defaults using ANNs, Zhang et al. (2020) analyzed variable layer of
the ANN model. They noted that through the analysis, that greater depth of the models led to increased performance
but with much lower rates of incremental improvement. These results imply that even though deeper architectures
improve accuracy, one must design a model that balances depth and accuracy.
[17]
2. Methodology
This section presents the procedures and procedures of carrying out the comparative analysis of loan risk prediction
by applying 4-layer, 5-layer and 6-layer Artificial Neural Networks. The methodology is divided into key phases: It
identifies the steps starting from dataset selection and preprocessing, model architecture and training and evaluation
and the comparative analysis section.
2.1 Dataset selection
The dataset utilized for the study of Loan Risk Prediction
is sourced from Bank, specifically the” Bank-Loan-Dataset”
dataset, which is collection form a Bangladeshi Bank.
Data used in this study will be collected from the banking sector. The dataset contains 34 attributes (columns) and
329414 rows. The dataset will include key features, such as:
Loan amount
Interest rate
Borrower income
Employment status
Credit score
Loan term
Debt-to-income ratio
Loan purpose
Some of these factors are well understood predictors of the likelihood of loan default in the financial sector.
Fig. 1: Flow chart of proposed diagram.
2.2 Data preprocessor
Everybody knows that data pre-processing is a critical phase of a constituent exercise in machine learning. However,
there are few other pre-processing techniques that can be used in exceptional circumstances as follows.
Enhancement of each one of input data is the main reason why data pre- processing is done. In this task, I employed
TensorFlow/Keras model which is a tremendously significant part of all the data preprocessing steps for a
classification problem. These transformations make up a set of preprocessing stages that act on the row data before
feeding them into the artificial neural network for training.
[18]
Here’s a broad description
of the preprocessing steps
encoded in the class, along with a detailed explanation of each step and its importance for classification:
The management of the missing values, outliers and or erroneous entries. All the holes in the data will be filled by
either means or medians while very extreme values in the databases will be handled using methods such as z-score
normalization.
The code prays away from the mean and scales down the data arrays to the division by the standard deviation. This
step is crucial for standardize neural network performance.
[19]
It standardizes the pixel intensity values so as to increase
the value of the dataset mean to zero and the standard deviation to one.
The mask is binarized by using a threshold that assigns pixels to the object of interest as well as the background. Loan
amount, interest rate, the borrowers income will be continuous data type and hence will be normalized or standardized
to bring variables to one scale and this leads to the improvement of
the neural networks.
Categorical variables like, loan purpose, and employment status are going to be encoded numerically in the described
data set, using methods like one-hot encoding.
That will be further divided into the training set at 70 % and the testing set at 30 % for accuracy of the model
analysis.
2.3 Machine learning models
A living systematic neural network in the brains of animals is modeled in machine learning by an artificial neural
network. An ANN, as the abbreviation says, is made up of connected units or nodes referred to as artificial neurons,
which only metaphorically resemble real neurons. This research proposed various layer configuration of artificial
neural network model mentioned above.
[13]
The study will implement three different artificial neural network
architectures:
2.3.1 Artificial neural network 4-layer architecture
The following Fig. 2 represents the architecture of a 4-layer ANN model, which has the following parts: The input
layer consists of 10 neurons and the output layer has only one neuron. There are three hidden layers in this form of
architecture, each of the hidden layers has 32 neurons.
Fig. 2: Proposed 4-layer of ANN architecture.
2.3.2 Artificial Neural Network 5-Layer Architecture
The following Fig. 3 represents the architecture of a 5-layer ANN model, which has the following parts: The input
layer consists of 10 neurons and the output layer has only one neuron. There are three hidden layers in this form of
architecture, each of the hidden layers has 32 neurons.
Fig. 3: Proposed 5-layer of ANN architecture.
2.3.3 Artificial neural network 6-layer architecture
The next Fig. 4 below depicts a 6-layer ANN model, which has the following parts: The input layer consists of 10
neurons and the output layer has only one neuron. There are four hidden layers in this form of architecture, each of
the hidden layers has 32 neurons.
Fig. 4: Proposed 6-layer of ANN architecture.
Regarding the architecture, each kind of model will be a feedforward one with fully connected layers. The frequency
of neurons in the hidden layer will be decided based on a preliminary experiment, but they will begin with a regular
setting of neurons used in standard ANN models (32 neurons per hidden layer). The last layer of the ANN will continue
to have a single neuron with an activation function of sigmoid
as the network will be using binary classification
(default, no default). Key configuration details:
Activation functions: ReLU (Rectified Linear Unit) will be used as a function for all hidden layers since it reduces
the vanishing gradient problem considerably.
Loss function: Hence binary cross-entropy will be used as the loss function since the format of the task is a binary
one.
Optimizer: In training phase, the Adam optimizer will be used since it has features of both AdaGrad and RMSProp
optimizer used for large data set and neural networks.
[19]
Regularization techniques: More hidden layers will be added, and dropout layers will be added to lower the opcion
of overfitting, and L2 will be used to punish the complex models.
3. Experiments and results
3.1 Implementation environment
For the implementation we have used anaconda version 1.9.7,
[20]
an environment of python 3.7. Anaconda is a standard
platform for data science including many libraries of various algorithms. The other configurations are: Processor: Intel
core i5 Clock Rate: 1.7 GHz RAM: 8GB.
3.2 Dataset description
As mentioned above, we have used Bangladeshi Bank Loan dataset. Bank data of loan applications with several
attributes of the borrowers was applied in this study, including credit score, income, loan amount and purpose. Dealing
with the missing values, outliers and normalizing features for training ANN models was also done on the preprocessed
dataset obtained from the above steps. Performance of model was checked using training set (70%) and testing set (30%).
After the analysis of the 9 features, the final output of the dataset was “Status”, which contains identify loan high risk or
low risk.
3.3 Comparison of performance metrics result
We have calculated performance metrics for the four-layer, five-layer and six-layer artificial neural networks in the raw
dataset. The performance metrics of ANN algorithms with different layers are depicted in Table 1.
Table 1: Determining the best result amongst the various layer model.
Accuracy
Precision
Recall
F1 Score
AUC-ROC
Simple ANN
85.85%
77.44%
51.54%
61.89%
0.88
4-Layer ANN
90.64%
91.52%
63.95%
75.29%
0.93
5-Layer ANN
90.70%
90.49%
65.13%
75.74%
0.93
6-Layer ANN
90.95%
90.04%
66.81%
76.71%
0.93
In this table, we found that the 6-Layer Artificial Neural Network was given the best accuracy (90.95%).
Accuracy: The best accuracy of 90.95%, was of the 6- layer ANN, which meant that the network was better at
predicting correct outcomes for loans among all the architectures tested. Overall, the 5-layer model was closely
followed by a percentage of 90.70%, while the smallest percentage belonged to the 4-layer model, only 90.64%.
Precision: The first measure of precision stated as the ratio of successfully identified positive instances out of the
overall identified positive instances was 91.52% for the 4-layer model. The precision of the 5-layer model was 90.49%
while that of 6-layer model was 90.04%. This also shows that the shallow ones is more effective than the deeper
networks in reducing False positive cases.
Recall: The precision of treatment which quantifies the proportion of correctly predicted positive observations
against the actual observation in the current stay was also highest for the 6-layer ANN at 66.81% for recall. The 5-
layer model gave 65.13% recall while the 4-layer model gave 63.95% recall. This implies that deeper models were in
a better position to identify loan defaults.
F1 Score: The F1 score better if the harmonic mean of precision and recall and the highest value of 76.71%
was scored by the 6-layer model. The 5-layer model was 75.74% in F1 score and the 4-layer model scored 75.29%
in F1 score. From measurements derived from the outcomes, it is evident that the 6-layer ANN presented a good balance
between precision and recall.
AUC-ROC: The AUC-ROC was highest 0.93 and its constraint for every layer. The experiment also showed
promising results of the 6- layer model with AUC-ROC = 0.93, 5- layer model with AUC-ROC = 0.93, and the 4-
Layer model had AUC-ROC of 0.93.
Fig. 5: Accuracy and loss curve.
3.4 Correlation between features
There are many reasons for the relations between dataset features. Relations between dataset give a useful analysis and
using the relation between features we can better understand the relationships between variables of the dataset. In the
statistical field, Relation be- tween two known as correlation.
Correlation can be positive and it also can be negative. When it becomes positives then that means there was a positive
relationship between those two variables. On the other hand, when it becomes negative then that means there was a
negative relationship between those two variables. Another exceptional thing is that when we get correlation value is
zero then that means those variables are independent. The co-relation between features is given in Fig. 6.
As far as the correlation in Fig. 6 for ‘Rate-of-Interest’ and ‘Status’ is concerned, correlation Coefficient 0.4 is higher
than every single feature.” This implies that with an increase in the ‘Rate-of-Interestthere is corresponding increase
in the incidence of loan default.
Fig. 6: Co-relation between features.
4. Conclusion and future work
The findings were corroborated through our study which showed that the 5-layer and 6-layer of ANN were more
accurate than the 4-layer network, also, in terms of accuracy, Precision, Recall, F1 score and AUC ROC. The 6-layer
model recorded the best performance in all the metrics applied a result showing that the architecture had the best
capacity to capture the complex patterns in the loan data. But the performance improvement for network depth
beyond 5 layers was not significantly promising suggesting that there is diminishing returns in terms of prediction
when network complexity increases. The chosen 5-layer ANN proved to be very effective from the point of view of
both predictiveness and computation time, showing no significant difference from the 6-layer model and being more
immunized against overlearning and less computationally demanding. This also suggests that a 5-layer architecture is
a feasible model for building real-world Apps where scalability and performance are priorities. In future we will apply
more advanced tricks in Artificial Neural Network, such as more hybrid models, algorithm optimization would be
more accurate in this case.
Conflict of Interest
There is no conflict of interest.
Supporting Information
Not applicable
Use of artificial intelligence (AI)-assisted technology for manuscript preparation
The authors confirm that there was no use of artificial intelligence (AI)-assisted technology for assisting in the writing
or editing of the manuscript and no images were manipulated using AI.
References
[1] https://thefinancialexpress.com.bd/views/reviews/default-loans-cancer-of-the-banking-system-1584288344,
accessed in January 2025
[2] https://www.geeksforgeeks.org/artificial-neural-networks-and-its-applications/, accessed in January 2025.
[3] L. C. Thomas, Credit Scoring and Its Applications, Guide books. Guide books, 2002.
[4] E. I. Altman, Financial ratios, discriminant analysis and the prediction of corporate bankruptcy, The Journal of
Finance, 1968, 589–609, doi: 10.2307/2978933.
[5] R. Malhotra, D. K. Malhotra, Evaluating consumer loans using neural networks, Omega, 2003, 31, 83–96, doi:
https://doi.org/10.1016/S0305-0483(03)00016-1.
[6] H.-V. S. Stefan Lessmann, B. Baesens, L. C. Thomas, Bench- marking state-of-the-art classification algorithms for
credit scoring: An update of research, European Journal of Operational Research, 2015, 247, 124–136, doi:
10.1016/j.ejor.2015.05.030.
[7] Y. Xu, Y. Peng, F. Shen, Y. Chen, K. Chang, S. Kou, Bankruptcy prediction for smes using transactional data and
two-stage multiobjective feature selection, Decision Support Systems, 2021, 140, 113429, doi:
10.1016/j.dss.2020.113429.
[8] J. Zhang, Financial default risk prediction algorithm based on neural network under the background of big data,
Mobile Information Systems, 2022, 1–11, doi: 10.1155/2022/8743778.
[8] J. Heaton, An empirical analysis of feature engineering for predictive modeling, in Proceedings of SoutheastCon
2016, 2016, 1–6.
[10] I. Goodfellow, Adversarial perturbations of deep neural networks, in Perturbations, Optimization, and Statistics.
The MIT Press, 2016, 311–342.
[11] G. E. Hinton, Reducing the dimensionality of data with neural net- works, Science, 2006, 313, 504–507, doi:
10.1126/science.1127647.
[12] Y. B. Yann LeCun, G. Hinton, Deep learning, Nature, 2015, 521, 436–444, doi: 10.1038/nature14539.
[13] J. Brownlee, How to configure the number of layers and neurons in a neural network, 2019.
[14] B. C. Tien Nguyen, W. Zhou, Machine learning models for credit rating: A comparative study, Journal of Risk
Finance, 2018, 19, 168–188.
[15] R. T. Trevor Hastie, J. Friedman, The elements of statistical learning: data mining, inference, and prediction, 2nd
ed. Springer, 2009.
[16] C. G. A. Lakshmanarao, U. R. C. S. Koppireddy, D. Dev, Loan default prediction using machine learning
techniques and deep learning ann model, in Proceedings of the 2023 Annual International Conference on Emerging
Research Areas: International Conference on Intelligent Systems (AICERA/ICIS), 2023,1–5.
[17] Y. W. Zhe Wang, X. Zhang, Attention-based dynamic multilayer graph neural networks for loan default prediction,
General Finance, 2024.
[18] P. B. Mart´ın Abadi, Z. C. Jianmin Chen, and A. Davis, Tensorflow: A system for large-scale machine learning,
Association for Computing Machinery, 2016.
[19] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization, in Proceedings of the International
Conference on Learning Represen- tations (ICLR), 2015.
[20] https://anaconda.com/distribution/, accessed in January 2025
Publisher Note: The views, statements, and data in all publications solely belong to the authors and contributors. GR
Scholastic is not responsible for any injury resulting from the ideas, methods, or products mentioned. GR Scholastic
remains neutral regarding jurisdictional claims in published maps and institutional affiliations.
Open Access
This article is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License, which
permits the non-commercial use, sharing, adaptation, distribution and reproduction in any medium or format, as long
as appropriate credit to the original author(s) and the source is given by providing a link to the Creative Commons
License and changes need to be indicated if there are any. The images or other third-party material in this article are
included in the article's Creative Commons License, unless indicated otherwise in a credit line to the material. If
material is not included in the article's Creative Commons License and your intended use is not permitted by statutory
regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view
a copy of this License, visit: https://creativecommons.org/licenses/by-nc/4.0/
©The Author 2025