You are on page 1of 20

MINOR PROJECT

MID SEM REPORT

ON

Implementation and analysis of Loan Approval system using Artificial


Intelligence

Submitted By

Nandita Bhartiya Himani Singhal Kanishk Aggarwal Naman Mittal


500045740 500045453 500045543 500045575

Under the guidance of


Mrs. Niharika Singh
Assistant Professor (SS)
Department of Informatics

Department of Virtualization
School of Computer Science and Engineering
Bidholi, Via Prem Nagar, Dehradun, UK
Jan-May’18

1
CANDIDATE’S DECLARATION

We hereby certify that the project work entitled “ Implementation and analysis of Loan
Approval system using Artificial Intelligence” in partial fulfillment of the requirements for the
award of the Degree of BACHELOR OF TECHNOLOGY in COMPUTER SCIENCE AND
ENGINEERING with specialization in CLOUD COMPUTING AND VIRTUALIZATION
TECHNOLOGY and submitted to the Department of Computer Science & Engineering at Center
for Information Technology, University of Petroleum & Energy Studies, Dehradun, is an authentic
record of our work carried out during a period from January, 2018 to May, 2018 under the
supervision of Mrs. Niharika Singh, Assistant Professor (SS), SoCSE, UPES.

The matter presented in this project has not been submitted by me/ us for the award of any
other degree of this or any other University.

Nandita Bhartiya Kanishk Aggarwal Himani Singhal Naman Mittal


R110215079 R110215061 R110215055 R110215078

This is to certify that the above statement made by the candidate is correct to the best
of my knowledge.

Date: _____________2018 Mrs. Niharika Singh

Project Guide
Dr. Amit Agarwal
Head of the Department <CCVT>
School of Computer Science and Engineering
University of Petroleum & Energy Studies
Dehradun – 248 007 (Uttarakhand)

2
ACKNOWLEDGEMENT

We wish to express our deep gratitude to our guide Mrs. Niharika Singh, for all advice,
encouragement and constant support he has given us throughout our project work. This work
would not have been possible without his support and valuable suggestions.

We sincerely thank to our respected Program Head of the Department, Dr. Amit Agarwal, for his
great support in doing our project in Area (like Network, Big data etc.) at CIT.

We are also grateful to Dr. Manish Prateek Director, SoCS and Dr. Kamal Bansal Dean CoES,
UPES for giving us the necessary facilities to carry out our project work successfully.

We would like to thank all our friends for their help and constructive criticism during our project
work. Finally, we have no words to express our sincere gratitude to our parents who have shown
us this world and for every support they have given us.

Nandita Bhartiya Kanishk Aggarwal Himani Singhal Naman Mittal


R110215079 R110215061 R110215055 R110215078

3
ABSTRACT

Banks are major providers for loans for employees working in different organizations. With the
enhancement in the banking sector, lots of people apply for bank loans but the bank has its limited
assets which it has to grant to limited people only, this can turn hectic and in many case its wiser
to advice human intelligence rather than an automated system, but again it would be very tedious
for humans alone to compute this amount of data. So as per the demand of the situation it would
be highly efficient to let artificial intelligence be utilized. Banking application for loan approval
system project scope is to design an application which can atomize the concept of loan
management. Banks are using more advanced methods to verify user’s information and know
accurate information about user before approving loan. There is loan management software where
users give their details and these systems determines that a client's loan can be granted or not.
Such applications are helping banks and users to provide fast and accurate method for loan
approval. In our Project, we are implementing this is by using artificial intelligence technique i.e.
multi-layer feed-forward neural network with backpropagation learning algorithm. We are
implementing this by mining the data of the previous records of the people to whom the loan was
granted before and on the basis of these records/experiences the neural network will be trained
using the backpropagation algorithm which give the most accurate result. The main objective of
this project is to predict whether assigning the loan to particular person will be safe or not using
Artificial neural network.

Keywords: Intelligence, Automated, Artificial, Neural, Network, Banking

4
1. INTRODUCTION

Distribution of the loans is the core business part of almost every bank. The main portion the
bank’s assets directly came from the profit earned from the loans distributed by the banks. The
prime objective in banking environment is to invest their assets in safe hands where it is. Today
many banks/financial companies approve loan after a regress process of verification and validation
but still there is no surety whether the chosen applicant is the deserving right applicant out of all
applicants.

There are many drawbacks of existing systems which require human intelligence for the loan
approval application:

 Doesn’t provide faster and effective system


 Doesn’t provide good co-ordination between departments
 Doesn’t provide effective forwarding system to move the file from one level to another
 No user-friendly interface
 Difficulty in generating different reports as per the business requirement

Through this system we can predict whether that particular applicant is safe or not. We are using
artificial neural network as an enabling tool for evaluating credit applications to support loan
decisions. We are implementing the proposed model using a multi-layer feed-forward neural
network with backpropagation learning algorithm. A multilayer neural network is a nonlinear
statistical data modeling tool. It is usually used to model complex relationships between inputs
and outputs, to find patterns in data, or to capture the statistical structure in an unknown joint
probability distribution between observed variables. A neural network has three layers: the input
layer namely, the hidden layer(s) and the output layer. Hidden layers form a processing bridge
between source and destination. The most significant elements in the NN are: The neuron (the
processing element) which has an input or more and only one output and the interconnection
between the processing elements which are represented by weights. There are three basic phases
of NN learning, recalling and testing. The system is trained on historical examples of input and
output variables. The prediction of loan approval is done using appropriate prediction algorithm
and providing the new data set associated with the applicant.

2. PROBLEM STATEMENT

Often banks are challenged by the manual processing of loans, creating spiraling labor costs and
backlogs of files preventing loans from closing on schedule. This translates into loss of business
to competition. For this reason, many Indian banks and financial institutions are now following
the footsteps of their global counterparts in automating their lending processes, covering the entire
loan life cycle – from loan origination through loan application process, risk assessment, decision-
making, monitoring, and management control of approved loans. So we are building an automated
Loan Approval System which will determine the customer chances of getting a loan.

5
3. OBJECTIVES
These are the objectives achieved.

 Implementing the neural network


 Training the network using historical data set
 Predicting the outcome using new data set

4. METHODOLOGY
Phases involved in our methodology:

1. Business understanding

2. Data collection

3. Data pre-processing

4. Modelling the solution

5. Training the system

6. Testing the data set

7. Prediction of Loan

1. Business understanding: Even if banks are more flexible towards business loans,
client’s application may be declined. Clients need to prepare themselves before applying
to increase their chances for loan approval. Lenders want detailed information about the
financial history of the business. They can prepare themselves by creating a detailed
business plan with a profit and loss budget and cash flow forecast. Loan approval depends
heavily on how well their business loan proposal is researched and presented. If they are
considered at high risk, their application may be declined despite having a strong business.

2. Data Collection: Every new applicant details filled at the time of application form acts
as a test data set. The data related to the predictors is provided to the network input layer.
After the operation of testing, model predict whether the new applicant is a fit case for
approval of the loan or not based upon the inference it concludes on the basis of the training
data sets.

6
3. Data pre-processing: The noise in the data is removed in this step so as to get better
Prediction result.

 Data Preparation: Data preparation is to define and process the mining data to make
it fit specific data mining method. Data preparation is the first important step in the
data pre-processing and plays a decisive role in the entire data mining process.
 Data cleaning: Data cleansing is to fill the vacancy value of the data, eliminate the
noise data and correct the inconsistencies data in the data.
 Data option: Data option is to select the data arrange and row used in this mining.

 Data expression: Data expression is to transform the data after pre-processing into the
form which can be accepted by the data mining algorithm based on neural network.
The data mining based on neural network can only handle numerical data, so the need
is to transform the sign data into numerical data. The simplest method is to establish a
table with one-to-one correspondence between the sign data and the numerical data.

4. Modelling the solution

 Specifying Loan Variables: In relation to loan applications evaluation, a set of decision


variables that determine the credit worthiness of an application has to be used. The
information that is considered as significant includes: the applicant's characteristics such
as his age, account type, income, nationality, residency, companies' type, guarantor, job
experience, and the DBR (i.e. debt balance ratio).
 Defining the network parameters: We need to decide optimal parameters. Our
parameters should be the combination of parameters which produces minimal error. After
conducting a no. of experiments, the best network can be retained. A series of repeated
trials is to be applied in order to reach the optimal set of parameters.
 Number of hidden neurons: The objective of the first successive trials was to hit upon
the optimal number of hidden neurons that would enable the network to evaluate loan
applications with the best performance.

5. Training Artificial Neural Network: Processing of artificial neural network is


done in three phases: training, validating, and testing. Firstly, network is trained using
input dataset. In this process the weights are adjusted such that the mean squared error
obtained between the experimental and obtained result can be minimized. More the input
data set used for training accurate will be the result, as it will have more data available for
training.

7
In Back propagation algorithm the error is back propagated and respectively the weights are
adjusted in order to reduce the error. The iteration continues until target value with minimum error
is reached. At the beginning of the training process, the connections between the neurons are set
to random weight W Artificial Neural Networks has matured over a past few years. Neural
network provides methodology of solving highly non-linear problems. Inspired by brain as ANN
is interconnection of highly non-linear neuron. The neurons are connected to each other via link.
This network is trained using Back-propagation algorithm which follows quasi newton method.
During the training process, the input and output data from the training data subset are fed into the
network. The difference between training output and actual output values is then calculated and
the it is trained and validated.

6. Testing the neural network: Testing of neural network is done using testing data
set. The inputs are given to the neural network and the output is calculated and checked
against the output value of the data set to verify the working of neural network

7. Prediction: After training and testing the data set, the inputs of the prediction data set is
provided to the neural network and it gives the predicted output.

Techniques:
1. Use Case Diagram

Fig. 1 Use case for loan approval

8
2. Flow Chart Diagram

Fig.2 Flow Chart

9
3. Sequence Diagram

Fig.3 Sequence diagram for loan approval

10
PSEUDO-CODE

1. Data set is created

a) Data set path is specified using-


data_set.set_data_file_name("path");
b) Data set separator(,) is specified
data_set.set_separator("Comma");
c) Data set is loaded using data_set.load_data();

2. Variables of the data set are fetched and named -

a) data_set.get_variables_pointer(); // data set fetched

b) names of variables are initialized using

variables_pointer->set_name

3. Data is scaled for better performance using

a) Instances* instances_pointer = data_set.get_instances_pointer();

instances_pointer->split_random_indices();

b) maximum and minimum values of data set are set using -

data_set.scale_inputs_minimum_maximum()

5. Creation of neural network with 9 inputs and 1 output using

a) neural_network.set(9, 6, 1)

b) Setting up of inputs to neural network using-

inputs_pointer->set_information(inputs_information);

11
c)Providing the neural network with the outputs -

outputs_pointer->set_information(targets_information);

6. For the scaling of data, Creation of scaling layer is done -

a) neural_network.construct_scaling_layer();

b) Input statistics are sent to the scaling layer using-

scaling_layer_pointer->set_statistics(inputs_statistics);

7. Creation of the probabilistic layer for the handling of binary output data -

a) neural_network.get_probabilistic_layer_pointer();

8. Error of the network (Loss index) is calculated using -

a) Data set and neural network refrence is provided to loss index

LossIndex loss_index(&neural_network, &data_set);

9. The procedure used to ca rry out learning(Training Strategy) is specified -

a) loss index is passed to the training strategy using -

10. TrainingStrategy training_strategy(&l oss_index);

b) Setting up of quasi newton method as main algo -

training_strategy.get_quasi_Newton_method_pointer();

11. Model selection is done to optimize the network architecture using-

12
a) model_selection.set_training_strategy_pointer(&training_strategy);

b) Setting the model as Simulated Annealing-

model_selection.set_order_selection_type(ModelSelection::SIMULATED_ANNEALING);

c) Setting max number of iterations using-

simulated_annealing_order_pointer>set_maximum_iterations_number(15);

12. Training of neural network is completed.

13. Providing inputs for prediction using-


Vector<double> inputs(9, 0.0);

inputs[i] = value

14. Predicting the loan approval using output -

a) if(outputs>=0.5)
output-Yes, Loan can be given\n";

else -not given

15. Making of confusion matrix using -

a) Matrix<size_t> confusion = testing_analysis.calculate_confusion();

confusion.save("../data/confusion.dat")

16. End the program

13
PROGRAM CODE

#include <iostream>
#include <time.h>

#include "../opennn/opennn.h"

using namespace OpenNN;

int main(void)
{
try
{

std::cout << "OpenNN. Loan Data Application.\n" << std::endl;

std::cout<<"Gender,Married,Education,Self_Employed,ApplicantIncome,CoapplicantIncome,Lo
anAmount,Loan_Amount_Term,Credit_History,Loan_Status\n\n";
srand((unsigned)time(NULL));

// Global variables

DataSet data_set;

NeuralNetwork neural_network;

LossIndex loss_index;

TrainingStrategy training_strategy;

ModelSelection model_selection;

// Data set
data_set.set_separator("Comma");
data_set.set_data_file_name("../data/loan.dat");

data_set.load_data();

data_set.set_file_type("dat");

// Variables

Variables* variables_pointer = data_set.get_variables_pointer();

14
variables_pointer->set_name(0, "Gender");
variables_pointer->set_name(1, "Married");
variables_pointer->set_name(2, "Education");
variables_pointer->set_name(3, "Self_Employed");
variables_pointer->set_name(4, "ApplicantIncome");
variables_pointer->set_name(5, "CoapplicantIncome");
variables_pointer->set_name(6, "LoanAmount");
variables_pointer->set_name(7, "Loan_Amount_Term");
variables_pointer->set_name(8, "Credit_History");
variables_pointer->set_name(9, "Loan_Status");

data_set.print_data_preview();
std::cout<<"\n";
data_set.print_summary();

// Instances

Instances* instances_pointer = data_set.get_instances_pointer();

instances_pointer->split_random_indices();

const Matrix<std::string> inputs_information = variables_pointer-


>arrange_inputs_information();
const Matrix<std::string> targets_information = variables_pointer-
>arrange_targets_information();

const Vector< Statistics<double> > inputs_statistics =


data_set.scale_inputs_minimum_maximum();

// Neural network

neural_network.set(9, 6, 1);

Inputs* inputs_pointer = neural_network.get_inputs_pointer();

inputs_pointer->set_information(inputs_information);

Outputs* outputs_pointer = neural_network.get_outputs_pointer();

outputs_pointer->set_information(targets_information);

neural_network.construct_scaling_layer();

ScalingLayer* scaling_layer_pointer = neural_network.get_scaling_layer_pointer();

15
scaling_layer_pointer->set_statistics(inputs_statistics);

scaling_layer_pointer->set_scaling_method(ScalingLayer::NoScaling);

neural_network.construct_probabilistic_layer();

ProbabilisticLayer* probabilistic_layer_pointer =
neural_network.get_probabilistic_layer_pointer();

probabilistic_layer_pointer->set_probabilistic_method(ProbabilisticLayer::Probability);

// Loss index

loss_index.set_data_set_pointer(&data_set);
loss_index.set_neural_network_pointer(&neural_network);

// Training strategy

training_strategy.set(&loss_index);

QuasiNewtonMethod* quasi_Newton_method_pointer =
training_strategy.get_quasi_Newton_method_pointer();

quasi_Newton_method_pointer->set_minimum_loss_increase(1.0e-6);

quasi_Newton_method_pointer->set_display(false);

training_strategy.set_display(false);

// Model selection

model_selection.set_training_strategy_pointer(&training_strategy);

model_selection.set_order_selection_type(ModelSelection::SIMULATED_ANNEALING);

SimulatedAnnealingOrder* simulated_annealing_order_pointer =
model_selection.get_simulated_annealing_order_pointer();

simulated_annealing_order_pointer->set_cooling_rate(0.9);

simulated_annealing_order_pointer->set_maximum_iterations_number(15);

16
ModelSelection::ModelSelectionResults model_selection_results =
model_selection.perform_order_selection();

//int a;
Vector<double> inputs(9, 0.0);
Vector<double> outputs(1, 0.0);
//std::cout<<"Enter input values\n";
/*for(int i=0;i<10;i++) {
std::cin>>a;
inputs[i] = a;
}*/
inputs[0] = 1;
inputs[1] = 1;
inputs[2] = 1;
inputs[3] = 0;
inputs[4] = 4583;
inputs[5] = 1508.0;
inputs[6] = 128.0;
inputs[7] = 360.0;
inputs[8] = 1.0;

outputs = neural_network.calculate_outputs(inputs);
if(outputs>=0.5)
std::cout<<"\nYes, Loan can be given\n";
else
std::cout<<"\nNo, Loan cannot be given\n";

TestingAnalysis testing_analysis(&neural_network, &data_set);

Matrix<size_t> confusion = testing_analysis.calculate_confusion();


confusion.save("../data/confusion.dat");

return(0);
}

catch(std::exception& e)
{
std::cerr << e.what() << std::endl;

return(1);
}
}

17
OUTPUT SCREENS

18
19
REFERENCES
[1] Amin Hedayati Moghaddama, Moein Hedayati Moghaddam, "Journal of Economics,
Finance and Administrative Science”.
[2] Kumar A'run, Garg Ishan, “Loan Approval Prediction based on Machine Learning
Approach”.
[3] Shorouq Fathi Eletter, Saad Ghaleb Yaseen, “Neuro-Based Artificial Intelligence Model
for Loan Decisions”.
[4] Aboobyda Jafar Hamid,Tarig Mohammed Ahmed, “Developing Prediction Model Of
Loan Risk In Banks Using Data Mining”.
[5] Shorouq Fathi Eletter, Saad Ghaleb Yaseen, “Applying Neural Networks for Loan
Decisions in the Jordanian Commercial Banking System”.

20

You might also like