Making AI Fair for Everyone
Detect, measure, and fix hidden bias in AI systems โ powered by Google Gemini
AI systems used in hiring, lending, criminal justice, and healthcare are making biased decisions that discriminate against real people โ and most organizations don't even know it.
| Real-World Case | What Happened |
|---|---|
| COMPAS (US Courts) | Black defendants rated HIGH risk at 2ร the rate of white defendants |
| Amazon Hiring AI | Algorithm penalized resumes containing "women's" โ 57% score penalty |
| Healthcare AI | Black patients 41% less likely to be correctly identified as high-need |
83% of HR AI tools show gender bias. These aren't hypothetical โ these are documented cases.
FairLens is a full-stack AI-powered platform that makes bias auditing accessible to everyone โ no ML expertise required.
Upload CSV โ 4 Fairness Metrics in 60s โ Gemini AI Explains in Plain English โ PDF Report
| Feature | Description |
|---|---|
| ๐ One-Click Bias Audit | Upload any CSV โ get DPD, EOD, DIR, Cramรฉr's V metrics instantly |
| ๐ค Gemini AI Explanations | Plain-English verdict, key findings, who's affected, fix suggestions |
| โ๏ธ Legal Compliance | Auto-checks against EU AI Act, EEOC 4/5 Rule, ISO 42001 |
| ๐ PDF Audit Reports | Professional downloadable reports for compliance teams |
| ๐ 10 Language Support | Re-generate analysis in Hindi, Spanish, Arabic, French & more |
| ๐ฌ Ask Gemini Q&A | Interactive chat โ ask questions about your audit results |
| ๐ฏ What-If Simulator | Remove attributes & see fairness score change in real-time |
| ๐ Shareable Audit Links | Make any audit public with one click โ no login needed to view |
| โก No-Login Live Demo | Try 3 real datasets instantly โ COMPAS, Adult Income, German Credit |
| ๐ Google Sign-In | One-click OAuth 2.0 authentication |
| ๐ Dark/Light Theme | Full theme support across the dashboard |
| ๐ฑ Mobile Responsive | Works seamlessly on desktop, tablet, and mobile |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FRONTEND (Next.js 16) โ
โ Landing ยท Dashboard ยท Audit Results ยท Demo ยท Auth Pages โ
โ Tailwind CSS ยท Framer Motion ยท Recharts โ
โ Deployed on Render โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ REST API (Axios)
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BACKEND (FastAPI Python) โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โAuth โ โAudit โ โReport โ โGemini โ โ
โ โRouter โ โRouter โ โRouter โ โService โ โ
โ โJWT+OAuth โ โBias Eng. โ โPDF Gen. โ โMulti-Key โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ Deployed on Render โ
โโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโผโโโโโโโโโโโโ โโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโ
โ Neon PostgreSQL โ โ Google Gemini 2.5 Flash โ
โ (Cloud Database) โ โ (AI Analysis + Multi-Key) โ
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Layer | Technology |
|---|---|
| Frontend | Next.js 16 + TypeScript + Tailwind CSS |
| Animations | Framer Motion |
| Charts | Recharts |
| Backend | FastAPI (Python 3.11) |
| AI Service | Google Gemini 2.5 Flash (multi-key rotation) |
| Bias Analysis | fairlearn + pandas + scikit-learn + scipy |
| Auth | JWT (python-jose + bcrypt) + Google OAuth 2.0 |
| Database | Neon PostgreSQL (Cloud) / SQLite (local) |
| PDF Reports | ReportLab |
| Deployment | Render (Singapore region) |
- โ Google Gemini 2.5 Flash โ AI-powered bias explanations, fix suggestions, Q&A chat, multi-language support
- โ Google Sign-In (OAuth 2.0) โ One-click authentication
- โ Cloud Deployment โ Fully deployed and live on Render
| Metric | Fair Threshold | What It Measures |
|---|---|---|
| Demographic Parity Diff. (DPD) | < 0.10 | Gap in positive decision rates between groups |
| Equalized Odds Diff. (EOD) | < 0.10 | Gap in error rates (false positives/negatives) between groups |
| Disparate Impact Ratio (DIR) | > 0.80 | 80% rule โ EEOC 4/5 Rule from US employment law |
| Cramรฉr's V (Bias Attribution) | โ | How strongly each attribute drives unequal outcomes |
- Python 3.11+
- Node.js 18+
- Gemini API key from aistudio.google.com
git clone https://github.com/Manin1311/Exceptional_Duo.git
cd Exceptional_Duo/backend
pip install -r requirements.txt
copy .env.example .env # Windows
# cp .env.example .env # Mac/LinuxEdit backend/.env:
GEMINI_API_KEY=your_primary_key_here
GEMINI_API_KEY_1=your_second_key_here # optional, for rotation
SECRET_KEY=any-long-random-string
DATABASE_URL=sqlite:///./fairlens.db
ALLOWED_ORIGINS=http://localhost:3000๐ก Multiple API keys enable automatic rotation when one hits rate limits.
uvicorn main:app --reload --port 8000cd ../frontend
npm install
npm run dev| URL | Page |
|---|---|
| http://localhost:3000 | Landing page |
| http://localhost:3000/demo | Live demo (no login needed) |
| http://localhost:3000/register | Create account |
| http://localhost:3000/dashboard | Audit dashboard |
Exceptional_Duo/
โโโ frontend/ # Next.js 16 + TypeScript
โ โโโ app/
โ โ โโโ page.tsx # Landing page
โ โ โโโ login/ # Login page
โ โ โโโ register/ # Registration page
โ โ โโโ dashboard/ # Audit dashboard
โ โ โโโ demo/ # No-login demo page
โ โ โโโ audit/
โ โ โโโ new/ # New audit wizard
โ โ โโโ [id]/ # Audit results (authenticated)
โ โ โโโ public/[id]/ # Shared public audit view
โ โโโ lib/
โ โโโ api.ts # Axios API client
โ โโโ auth-context.tsx # Auth provider
โ โโโ wake-up.tsx # Backend wake-up ping
โโโ backend/ # FastAPI Python
โ โโโ main.py # App entry point
โ โโโ Dockerfile # Docker build
โ โโโ requirements.txt # Python dependencies
โ โโโ routers/
โ โ โโโ auth.py # JWT + Google OAuth
โ โ โโโ audit.py # Bias analysis + demo + share
โ โ โโโ report.py # PDF report generation
โ โโโ services/
โ โ โโโ gemini_service.py # Gemini AI (multi-key rotation)
โ โ โโโ bias_engine.py # Fairness metrics engine
โ โโโ models/
โ โ โโโ database.py # SQLAlchemy models
โ โ โโโ schemas.py # Pydantic schemas
โ โโโ demo_datasets/ # Pre-loaded CSV datasets
โ โโโ compas.csv
โ โโโ adult_income.csv
โ โโโ german_credit.csv
โโโ render.yaml # Render deployment blueprint
- ๐ Auto-Mitigation โ Automatically rebalance datasets to reduce bias
- ๐ CI/CD API โ REST API for pipeline integration (audit before deploy)
- ๐ฅ Team Workspaces โ Multi-user organizations with role-based access
- ๐ Bias Monitoring โ Track fairness scores over time
- ๐ง NLP & Image Bias โ Extend beyond tabular data
- ๐๏ธ More Regulations โ India DPDP Act, Canada AIDA