A complete professional banking application with machine learning-powered loan approval predictions, comprehensive user authentication, document verification system, and collateral-based eligibility checking. Built with Flask, SQLAlchemy, and scikit-learn.
- User Registration & Login: Secure bcrypt password hashing
- Session Management: Flask-Login integration
- Profile Management: Complete user profiles with personal, financial, and employment information
- PAN Card Verification: Format validation + simulated Income Tax Department lookup
- Aadhar Verification: 12-digit validation + simulated UIDAI e-KYC
- Bank Account Verification: IFSC validation + simulated NPCI penny drop
- CIBIL Score Verification: Credit score cross-checking with simulated bureau
- Income Verification: ITR cross-checking with variance detection
- Comprehensive Reports: Detailed verification results with scoring (0-100%)
- Gradient Boosting Model: 98.48% accuracy on real loan data
- Trained on 4,269 Real Applications: Actual loan approval patterns
- Real-time Predictions: Instant eligibility checks with confidence scores
- 11+ Features: Income, credit history, collateral, employment, and more
- Asset Verification: Residential, commercial, luxury assets, and bank deposits
- 20% Rule: Requires minimum 20% of loan amount in collateral
- Pre-Application Check: Prevents ineligible applications
- LOAN EASY Branding: Corporate banking design with navy/blue theme
- Responsive Design: Works on desktop, tablet, and mobile
- Modern Interface: Clean forms, status badges, verification cards
git clone https://github.com/YOUR_USERNAME/loan-easy.git
cd loan-easypython -m venv .venv
.venv\Scripts\activatepip install -r requirements.txtpython app_auth.pyOpen your browser and go to: http://127.0.0.1:5000
- Register with email and password
- Complete your profile (11 sections)
- Automatic verification runs!
- View verification results
- Apply for loans (if collateral requirement met)
Deployed on Vercel: https://loan-easy.vercel.app (Replace with your URL)
- Deployment Guide - GitHub & Vercel deployment steps
- Verification System - Document verification details
- Authentication System - User management guide
- Model Explanation - ML model training and performance
The model uses the following features:
| Feature | Description | Type |
|---|---|---|
| ApplicantIncome | Primary applicant's income | Numerical |
| CoapplicantIncome | Co-applicant's income | Numerical |
| LoanAmount | Requested loan amount (in $1000s) | Numerical |
| Loan_Amount_Term | Loan repayment period (months) | Numerical |
| Credit_History | Credit repayment history (0=Bad, 1=Good) | Binary |
| Gender | Applicant's gender | Categorical |
| Married | Marital status | Categorical |
| Dependents | Number of dependents | Categorical |
| Education | Education level | Categorical |
| Self_Employed | Employment type | Categorical |
| Property_Area | Urban/Semiurban/Rural | Categorical |
- Fast and interpretable
- Good for understanding decision rules
- Max depth limited to prevent overfitting
- RBF kernel for non-linear classification
- Probability estimates enabled
- Good for high-dimensional data
- Ensemble of 100 decision trees
- Reduced overfitting through averaging
- Generally highest accuracy
After training, you'll see:
- Test accuracy for each model
- Cross-validation scores (5-fold)
- Confusion matrices
- Classification reports
- Visual comparison chart saved as
model_comparison.png
The Flask application provides:
- Clean, modern UI with gradient design
- Input form for all loan features
- Real-time prediction with confidence score
- Responsive design for mobile devices
- Loading animations and result displays
loan-easy/
βββ app_auth.py # Main Flask application
βββ verification_service.py # Document verification module
βββ train_model_real.py # ML model training (real data)
βββ requirements.txt # Python dependencies
βββ vercel.json # Vercel deployment config
βββ wsgi.py # WSGI entry point
βββ runtime.txt # Python version
βββ .gitignore # Git ignore rules
β
βββ templates/ # HTML templates
β βββ base.html # Base template with LOAN EASY branding
β βββ index.html # Landing page
β βββ register.html # User registration
β βββ login.html # User login
β βββ dashboard.html # User dashboard
β βββ create_profile.html # Profile creation form (11 sections)
β βββ edit_profile.html # Profile editing
β βββ view_profile.html # Profile display
β βββ verification_results.html # Verification report
β βββ apply_loan.html # Loan application form
β βββ loan_result.html # Loan decision result
β βββ applications.html # Application history
β
βββ instance/ # Database folder
β βββ loaneasy.db # SQLite database
β
βββ real_data/ # Training data
β βββ loan_approval_dataset.csv # 4,269 real loan applications
β
βββ Models/ # Trained ML models
β βββ loan_model_real.pkl # Gradient Boosting model (98.48%)
β βββ label_encoders_real.pkl # Label encoders
β βββ feature_names_real.pkl # Feature names
β
βββ Documentation/
βββ README.md # This file
βββ DEPLOYMENT_GUIDE.md # GitHub & Vercel deployment
βββ VERIFICATION_SYSTEM_DOCS.md # Verification system details
βββ AUTHENTICATION_SYSTEM_COMPLETE.md # Auth system guide
βββ REAL_MODEL_SUCCESS.md # ML model documentation
-
Fill in all applicant information:
- Income details
- Loan amount and term
- Personal information
- Credit history
-
Click "Check Eligibility"
-
Get instant prediction:
- β Approved: Green success message with confidence %
- β Not Approved: Red rejection message with suggestions
Edit generate_data.py to adjust:
- Number of samples
- Feature distributions
- Approval logic rules
In train_model.py, adjust:
max_depthfor Decision Treen_estimatorsfor Random Forestkernelfor SVM
Edit templates in templates/ folder:
index.html- Main prediction interfaceabout.html- Information page
The model considers:
- Credit History (Most Important) - Good credit significantly increases approval chances
- Income-to-Loan Ratio - Higher income relative to loan amount is favorable
- Total Household Income - Combined applicant and co-applicant income
- Education Level - Graduates have slightly higher approval rates
- Property Location - Urban properties may have different criteria
# Run these commands in order:
python generate_data.py
python train_model.py
python app.py# Change port in app.py:
app.run(debug=True, port=5001)pip install --upgrade -r requirements.txt-
Push to GitHub:
git init git add . git commit -m "Initial commit" git remote add origin https://github.com/YOUR_USERNAME/loan-easy.git git push -u origin main
-
Deploy to Vercel:
- Go to vercel.com
- Click "Import Project"
- Select your GitHub repository
- Click "Deploy"
- Done! π
Full deployment guide: See DEPLOYMENT_GUIDE.md
Use these test credentials:
- PAN: ABCDE1234F (valid format)
- Aadhar: 123456789012 (any 12 digits)
- Bank IFSC: SBIN0001234 (valid SBI IFSC)
- Account: 12345678901234 (any 14 digits)
- CIBIL Score: 750
The system will verify all documents and show detailed results!
| Component | Technology |
|---|---|
| Backend | Python 3.11, Flask 3.0 |
| Database | SQLite (local), PostgreSQL (production) |
| Authentication | Flask-Login, Bcrypt |
| ORM | SQLAlchemy |
| Machine Learning | scikit-learn, Gradient Boosting |
| Frontend | HTML5, CSS3, JavaScript |
| Icons | FontAwesome 6.4 |
| Deployment | Vercel, GitHub |
- id, email, password_hash, full_name, phone, created_at
- id, user_id, pan_number, aadhar_number, date_of_birth
- bank_name, account_number, ifsc_code
- cibil_score, annual_income, employment_type
- residential_asset_value, commercial_asset_value, luxury_asset_value, bank_balance
- verification_report, verification_date (NEW!)
- pan_verified, aadhar_verified, bank_verified, cibil_verified, income_verified (NEW!)
- id, user_id, loan_amount, loan_term, purpose
- prediction_result, confidence_score, application_date
- β Password hashing with bcrypt
- β Session management with Flask-Login
- β CSRF protection
- β SQL injection prevention (SQLAlchemy ORM)
- β Input validation and sanitization
- β Secure secret key for production
- β Document verification to prevent fraud
Gradient Boosting Classifier:
- Accuracy: 98.48%
- Training Data: 4,269 real loan applications
- Features: 11 (income, credit history, collateral, etc.)
- Cross-Validation: 5-fold with 98% avg accuracy
Feature Importance:
- Credit History (35%)
- Total Income (25%)
- Loan-to-Income Ratio (20%)
- Collateral Value (10%)
- Other factors (10%)
- Email notifications for loan decisions
- SMS verification for phone numbers
- Integration with real government APIs (PAN, Aadhar)
- Real-time CIBIL score fetching
- Payment gateway integration
- Admin dashboard for loan management
- Document upload (PDF/images)
- e-Signature integration
- Mobile app (React Native)
- Multi-language support
# Delete and recreate database
Remove-Item instance\loaneasy.db
python app_auth.py# Retrain the model
python train_model_real.py# Find and kill process on port 5000
Get-Process python | Stop-Process -ForceThis project is open source and available for educational purposes.
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For questions or suggestions, please open an issue on the repository.
Give a βοΈ if this project helped you!
- β Added document verification system
- β Integrated PAN, Aadhar, Bank, CIBIL, Income verification
- β Professional LOAN EASY branding
- β Collateral-based eligibility checking
- β Comprehensive user profiles
- β Verification results page
- β User authentication system
- β Profile management
- β Loan application workflow
- β ML model training on real data
- β 98.48% accuracy achieved
- β Basic Flask web interface
Built with β€οΈ by the LOAN EASY Team
Happy Banking! οΏ½