Avertix is a production-ready Non-Performing Asset (NPA) prediction and risk intelligence platform designed for the Indian banking sector. Using cutting-edge machine learning techniques, explainable AI with SHAP, and network contagion analysis, Avertix predicts loan defaults 3-6 months in advance, enabling financial institutions to take proactive measures and reduce portfolio risk.
Perfect for: Hackathons, Demos, PoCs, and Production Deployments
Experience Avertix instantly:
- Visit the landing page
- Click "Start Free Demo"
- Create any account (no email verification required)
- Explore the full-featured dashboard with real ML predictions
Demo Features Unlocked:
- Real-time portfolio risk analytics
- SHAP-based explainable AI
- What-If scenario simulator
- Network contagion visualization
- Interactive loan detail pages
- Real-time risk prediction using LightGBM ensemble models
- Separate models for retail and corporate loan portfolios
- Chronological training with walk-forward validation
- Automated feature engineering from transactional and behavioral data
- SHAP (SHapley Additive exPlanations) waterfall charts for every prediction
- Transparent feature contribution analysis
- Audit-ready explanations for regulatory compliance
- Understand exactly why a loan is flagged as high-risk
- Interactive scenario testing for individual loans
- Simulate payment misses, utilization changes, and market shocks
- Predict impact before it happens
- Support proactive risk mitigation strategies
- Visualize corporate supply-chain relationships
- Detect systemic risk propagation across connected entities
- Graph-based analytics for corporate portfolio
- Early warning system for contagion effects
- Professional design inspired by Stripe, Plaid, and Mercury
- Smooth gradients and glassmorphism effects
- Clean, polished light theme optimized for financial data visualization
- Responsive design for desktop and mobile
- Production-ready Material-UI components with custom theming
- Portfolio-level Risk Simulator for stress-testing scenarios
- FastAPI: High-performance async Python web framework
- LightGBM: Gradient boosting framework for ML models
- SHAP: Explainable AI library for model interpretation
- Pandas/NumPy: Data processing and feature engineering
- NetworkX: Graph analysis for contagion detection
- React 19: Modern UI library with hooks
- TypeScript: Type-safe JavaScript for reliability
- Material-UI (MUI): Production-ready React components
- Recharts: Composable charting library
- React Router: Client-side routing
- Vite: Lightning-fast development and build tool
- Synthetic data generation for demonstration
- Feature engineering pipeline with 60+ behavioral features
- LightGBM classifier with hyperparameter tuning
- SHAP TreeExplainer for model interpretation
avertix/
├── backend/
│ ├── api/
│ │ └── main.py # FastAPI application and endpoints
│ ├── data/
│ │ ├── artifacts/ # Generated synthetic data
│ │ ├── generate_retail.py # Retail loan data generator
│ │ └── generate_corporate.py # Corporate loan data generator
│ ├── features/
│ │ ├── artifacts/ # Feature datasets (parquet)
│ │ ├── retail_features.py # Retail feature engineering
│ │ ├── corporate_features.py # Corporate feature engineering
│ │ └── cli.py # CLI for feature generation
│ ├── models/
│ │ ├── artifacts/ # Trained models and SHAP values
│ │ ├── train.py # Model training pipeline
│ │ └── shap_utils.py # SHAP computation utilities
│ ├── requirements.txt # Python dependencies
│ └── README.md # Backend documentation
├── frontend/
│ ├── src/
│ │ ├── api.ts # API client functions
│ │ ├── auth/ # Authentication utilities
│ │ ├── components/ # Reusable UI components
│ │ ├── contexts/ # React contexts (theme, toast)
│ │ ├── layouts/ # Page layouts
│ │ ├── pages/ # Route pages
│ │ ├── theme-neo.ts # Neobrutalism design system
│ │ └── main.tsx # Application entry point
│ ├── package.json # Node.js dependencies
│ └── README.md # Frontend documentation
└── README.md # This file
The fastest way to see Avertix in action:
# Terminal 1 - Start Backend (with pre-generated data)
cd backend
pip install -r requirements.txt
uvicorn api.main:app --reload --port 8080
# Terminal 2 - Start Frontend
cd frontend
npm install
echo "VITE_API_BASE=http://localhost:8080" > .env
npm run devThen open http://localhost:5173 and create an account to explore!
If you want to regenerate all data and models from scratch:
- Python 3.8 or higher
- Node.js 16 or higher
- npm or yarn package manager
- Navigate to the backend directory:
cd backend- Install Python dependencies:
pip install -r requirements.txt- Generate synthetic data:
python -m data.generate_retail
python -m data.generate_corporate- Generate features:
python -m features.cli --all- Train models:
python -m models.train- Start the API server:
uvicorn api.main:app --reload --port 8080The API will be available at http://localhost:8080
- Navigate to the frontend directory:
cd frontend- Install Node.js dependencies:
npm install- Create environment file:
echo "VITE_API_BASE=http://localhost:8080" > .env- Start the development server:
npm run devThe application will be available at http://localhost:5173
/- Professional landing page with features, testimonials, and CTAs/login- Secure login with demo-friendly messaging/signup- Quick account creation (no email verification needed for demo)
/app- Interactive dashboard with real-time portfolio KPIs and charts/app/loans- Advanced loans table with filters, search, and CSV export/app/loan/:loanId- Detailed loan view with SHAP waterfall and What-If simulator/app/contagion- Network contagion analysis with high-risk entity tracking
GET /api/health- Health checkGET /api/portfolio/summary- Portfolio KPIs and aggregated metricsGET /api/portfolio/segments- Segment breakdowns (region, product, industry)
GET /api/loans- Paginated loans list with filtersGET /api/loans/{loan_id}- Individual loan detailsGET /api/loans/{loan_id}/shap- SHAP explanation for a loanPOST /api/loans/{loan_id}/whatif- What-if scenario simulation
GET /api/graph- Corporate network graph data (nodes and edges)
- Bold neobrutalism design that stands out
- Clear value proposition with metrics
- Feature highlights with animated icons
- Customer testimonials for social proof
- Trust badges (RBI Compliant, GDPR Ready, etc.)
- Multiple CTAs for high conversion
- Professional footer with branding
- Real-time portfolio KPIs with dynamic color coding
- Risk distribution histogram with backend-computed bins
- 6-month risk trend line chart with smooth animations
- Segment breakdowns by retail and corporate
- Quick loan search with instant navigation
- Animated transitions and hover effects
- Responsive design for all screen sizes
- Paginated table with customizable rows per page (10/25/50/100)
- Filter by segment (retail/corporate)
- Filter by risk range (min/max)
- Sort by risk score (descending)
- Color-coded risk chips (green/yellow/red)
- Export to CSV functionality
- Click-through navigation to loan details
- Comprehensive risk score display
- SHAP waterfall chart showing positive and negative feature contributions
- What-if simulator with interactive controls:
- Payment miss scenarios
- Utilization adjustment sliders
- Real-time prediction updates
- Interactive graph visualization of corporate relationships
- Node coloring by risk score
- Edge thickness by relationship strength
- High-risk entity highlighting
- Network analysis insights
The current implementation uses a lightweight client-side authentication system:
- SHA-256 password hashing with random salt
- Session storage in localStorage
- Protected route guards with React Router
- No backend database required for demo purposes
Note: For production deployment, implement a robust backend authentication system with JWT tokens, secure password storage, and user management.
Synthetic data is generated for demonstration:
- Retail: 1,000 customers with personal loans, credit cards, mortgages
- Corporate: 100 companies with business loans and trade relationships
- Realistic temporal patterns and default scenarios
Behavioral and transactional features are computed:
- Payment history analysis
- Utilization trends
- Delinquency patterns
- Industry-specific indicators
- Network-based features (for corporate)
LightGBM models are trained with:
- Chronological train/test split
- Class imbalance handling
- Hyperparameter tuning
- Cross-validation
- Feature importance analysis
Model explanations are generated:
- TreeExplainer for efficient computation
- Tree path-dependent feature perturbation
- Base value and contribution vectors stored
- Used for real-time explanation generation
The models achieve strong performance on synthetic data:
- Retail Model: ~85% AUC-ROC, ~78% precision at 50% recall
- Corporate Model: ~88% AUC-ROC, ~82% precision at 50% recall
Note: These metrics are on synthetic data. Real-world performance will vary based on actual data quality and distribution.
-
Backend Infrastructure
- Deploy FastAPI with Gunicorn/Uvicorn workers
- Set up load balancing and auto-scaling
- Implement proper logging and monitoring
- Configure HTTPS and CORS policies
-
Database Integration
- Replace in-memory caching with Redis/Memcached
- Set up PostgreSQL or MongoDB for persistent storage
- Implement data versioning and audit trails
-
Authentication & Security
- Implement OAuth 2.0 or JWT-based authentication
- Set up role-based access control (RBAC)
- Enable API rate limiting and throttling
- Conduct security audits and penetration testing
-
Data Pipeline
- Replace synthetic data with real loan data
- Implement automated data ingestion pipelines
- Set up data quality checks and validation
- Schedule periodic model retraining
-
Frontend Optimization
- Enable production build with code splitting
- Configure CDN for static assets
- Implement service workers for offline support
- Set up error tracking (Sentry, LogRocket)
-
Compliance & Governance
- Document model development and validation
- Implement model monitoring and drift detection
- Create audit logs for all predictions
- Ensure GDPR/data privacy compliance
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test# Backend
cd backend
flake8 .
black .
# Frontend
cd frontend
npm run lint# Backend - ensure all dependencies are installed
cd backend
pip freeze > requirements.txt
# Frontend - create optimized build
cd frontend
npm run buildProblem: ModuleNotFoundError when running scripts
- Solution: Ensure you're in the
backenddirectory and run with-mflag (e.g.,python -m data.generate_retail)
Problem: Models not found when starting API
- Solution: Run the full data pipeline: generate data → generate features → train models
Problem: SHAP computation is slow
- Solution: This is normal for the first request. Results are cached for subsequent requests.
Problem: API calls failing with CORS errors
- Solution: Ensure backend is running on port 8080 and
.envfile has correctVITE_API_BASE
Problem: Charts not rendering
- Solution: Hard refresh the browser (Cmd+Shift+R on Mac, Ctrl+Shift+F5 on Windows)
Problem: Build errors with TypeScript
- Solution: Run
npm installagain and ensure TypeScript version is compatible
Problem: Empty or missing data files
- Solution: Re-run data generation scripts with
--forceflag if needed
Problem: Feature engineering fails
- Solution: Ensure data files exist in
backend/data/artifacts/before running feature generation
This is a prototype project for demonstration purposes. For collaboration:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is for educational and demonstration purposes. Please consult with the author before using in production or commercial applications.
- Built for the Indian banking sector to combat NPA challenges
- Inspired by modern risk management practices in fintech
- Uses open-source technologies and libraries
- Designed with scalability and explainability in mind
For questions, suggestions, or collaboration opportunities, please open an issue on the repository.
Avertix - Stop NPAs Before They Happen