Inspiration

Loan fraud costs financial institutions over $6 billion annually. Meanwhile, manual underwriting takes 2-5 days per application, creating bottlenecks that hurt both lenders and borrowers. We asked ourselves: what if AI could not only speed up underwriting but also catch fraud that humans miss?

The LMA EDGE hackathon's focus on "Digital Loans" was the perfect opportunity to build something that addresses both problems. We wanted to create a tool that micro-lenders, credit unions, and community banks could use to make faster, smarter, and more transparent lending decisions—without sacrificing compliance or accountability.

What it does

LoanLens is an AI-powered loan underwriting platform that transforms document analysis from days to seconds. Here's what it delivers:

  • Instant Document Analysis: Upload any pay stub, bank statement, or income proof. Our AI extracts and verifies data in under 5 seconds.

  • Fraud Detection: LoanLens doesn't just assess affordability—it catches fraudulent documents by detecting template markers, outdated dates, currency mismatches, and suspicious patterns.

  • Explainable AI Decision Flow: Using React Flow, we visualize exactly HOW the AI reached its decision—from document ingestion through verification, anomaly detection, and final recommendation. No black boxes.

  • Risk Radar Visualization: A multi-dimensional spider chart shows risk across four dimensions: Document Integrity, Employer Verification, Income Stability, and Affordability.

  • Compliance Letter Generation: Auto-generate regulatory-compliant adverse action notices and approval letters, ready to send to applicants.

  • Configurable Risk Engine: Lenders set their own DTI thresholds, confidence minimums, and verification strictness—full control over risk appetite.

How we built it

Frontend Architecture:

  • React 19 with TypeScript for type-safe, modern UI development
  • Vite for lightning-fast builds and hot module replacement
  • Custom glass-morphism dark theme UI system

AI/ML Pipeline:

  • Google Gemini 2.5 Flash for multimodal document analysis
  • OpenRouter API for reliable AI inference
  • JSON Schema structured outputs for 100% parseable responses
  • Custom prompt engineering for fraud detection heuristics

Data Visualization:

  • React Flow for interactive decision flow diagrams
  • Recharts for affordability and payment visualizations
  • Custom SVG-based Risk Radar component

Key Technical Decisions:

  • Zero backend architecture—runs entirely in browser for privacy and simplicity
  • Multimodal processing handles PDFs, PNGs, and photos without preprocessing
  • State management via React hooks for real-time UI updates

Challenges we ran into

  1. Structured AI Output Reliability: Getting Gemini to consistently return valid JSON with all required fields was tricky. We solved this with strict JSON Schema validation and fallback parsing logic.

  2. Fraud Detection Accuracy: Training the AI to distinguish between legitimate documents and templates required extensive prompt engineering. We built a detection system that catches outdated dates, placeholder names, template employers, and currency mismatches.

  3. Decision Flow Visualization: Mapping AI reasoning to an interactive flowchart required careful state management. We had to ensure the flow accurately reflects the actual decision logic, not just a pretty diagram.

  4. Balancing Speed vs. Depth: We wanted comprehensive analysis without sacrificing the "instant" feel. Optimizing prompts and parallel processing helped us achieve sub-5-second analysis times.

  5. UI/UX for Complex Data: Presenting fraud flags, risk scores, affordability metrics, and AI reasoning in a clean, non-overwhelming interface required multiple design iterations.

Accomplishments that we're proud of

🏆 Real Fraud Detection: Our AI successfully identified a test document as fraudulent, catching 5 separate integrity issues including an outdated date (2013), template employer name, and currency mismatch.

🏆 Explainable AI Implementation: The Decision Flow visualization makes our AI's reasoning completely transparent—a critical feature for regulatory compliance and user trust.

🏆 End-to-End Product: This isn't a proof-of-concept. LoanLens handles the complete underwriting workflow: upload → analyze → visualize → decide → document.

🏆 Professional UI Quality: The dark theme, glass-morphism cards, and intuitive navigation make LoanLens look like a production product, not a hackathon prototype.

🏆 Zero Backend Deployment: By running entirely client-side, we eliminated deployment complexity and ensured document privacy—no sensitive data ever hits a server.

What we learned

  • Prompt Engineering is Critical: The difference between good and great AI output comes down to how you structure prompts. We learned to use explicit schemas, examples, and constraints.

  • Visualization Builds Trust: Users don't trust AI they can't understand. The Decision Flow and Risk Radar transformed skepticism into confidence.

  • Fraud Detection is Underserved: Most loan tools focus on affordability. Adding fraud detection created immediate differentiation and real-world value.

  • Dark Theme Matters: For financial applications used for extended periods, dark themes reduce eye strain and convey professionalism.

  • Scope Management: We had dozens of feature ideas but focused on doing 5 things excellently rather than 15 things poorly.

What's next for LoanLens

📍 Multi-Document Analysis: Support for analyzing multiple documents per application (pay stubs + bank statements + tax returns)

📍 Portfolio Analytics Dashboard: Aggregate insights across all assessments—approval rates, common fraud patterns, risk trends

📍 API for Integration: RESTful API allowing lenders to integrate LoanLens into existing loan origination systems

📍 Islamic Finance Mode: Profit-sharing calculations and Shariah-compliant assessment criteria for Islamic banking markets

📍 WhatsApp Integration: Allow borrowers to submit documents via WhatsApp for emerging market accessibility

📍 Custom Fraud Pattern Training: Let lenders flag new fraud patterns they discover, improving detection over time

📍 Multi-Language Support: Arabic, Urdu, Spanish interfaces for global micro-lending markets

Built With

Share this project:

Updates