"Amazon's hiring AI downgraded women's CVs. COMPAS flagged Black defendants at 2× the rate. These failures could have been caught. FairFlow catches them."
AI makes life-changing decisions about jobs, loans, and healthcare. When trained on biased historical data, these systems don't just repeat discrimination — they amplify it at scale, silently, with serious consequences.
FairFlow gives any organization — NGO, school, small business — the ability to audit their data for bias before it causes harm. No data science degree required.
- Upload your CSV dataset
- Select your target column and sensitive attribute
- Optionally select a second sensitive attribute for intersectional analysis
- FairFlow computes SPD, Disparate Impact, and Equalized Odds
- SHAP explains which features are driving bias
- OpenAI translates everything into plain language
- Intersectionality heatmap reveals compounded disadvantage across identity combinations
- What-if simulator lets you drop features and measure bias impact in real time
- Download a full PDF audit report
Priya runs an NGO in Pune distributing scholarships. She uploads her dataset, selects gender as the sensitive attribute and caste as the intersect. She discovers that lower-caste girls are approved at a significantly lower rate than other groups. FairFlow explains why this is happening, identifies likely proxy features, and helps her test safer alternatives before deployment.
| Layer | Technology |
|---|---|
| Backend | FastAPI (Python 3.12) |
| Bias Metrics | SPD, Disparate Impact, Equalized Odds |
| Explainability | SHAP (TreeExplainer) |
| AI Layer | OpenAI (GPT-5.6) |
| Frontend | HTML / CSS / JS + Chart.js |
| PDF Export | ReportLab |
| Deployment | Render |
| Metric | Threshold | Meaning |
|---|---|---|
| Disparate Impact | < 0.8 = biased | Legal standard (EEOC 4/5ths rule) |
| Statistical Parity Difference | > 0.1 = biased | Outcome gap between groups |
| Equalized Odds | > 0.1 = biased | Error rate gap between groups |
Every existing tool — IBM AI Fairness 360, Fairlearn, Aequitas — outputs p-values and confusion matrices that only data scientists can interpret. FairFlow translates those results into plain language so decision-makers can actually act.
| Audience | Output |
|---|---|
| NGO worker | Policy implication |
| Student | Learning-oriented explanation |
| Policy maker | Legal risk framing |
FairFlow was built with heavy AI-assisted engineering and explanation workflows:
- Codex was used to accelerate implementation of backend endpoints, metric pipelines, and frontend integration tasks.
- GPT-5.6 powers the OpenAI integration layer that converts technical fairness outputs into clear, audience-specific explanations.
- AI-assisted iteration was used to refine:
- bias metric interpretation text,
- what-if remediation messaging,
- report structure and communication quality,
- developer productivity across debugging and feature delivery.
In short: Codex helped build FairFlow; GPT-5.6 helps FairFlow explain fairness.
git clone https://github.com/CheerathAniketh/FairFlow
cd FairFlow/backend
pip install -r requirements.txtCreate a .env file in the backend/ folder:
OPENAI_API_KEY=your_api_key_hereRun the server:
uvicorn main:app --reloadOpen http://127.0.0.1:8000 in your browser.
- FastAPI server with CORS middleware and multi-user session management
- CSV upload and parsing via
/analyzeendpoint - Bias metrics computed locally: SPD, Disparate Impact, Equalized Odds (real TPR/FPR per group)
- SHAP feature importance via
explainer.py - Model training and evaluation via
trainer.py(RandomForest, ROC + calibration curves) - OpenAI integration layer (GPT-5.6) for plain-language explanations with audience toggle
- Graceful fallback when OpenAI API quota is exhausted or API key is missing
- Smart label decoding: encoded columns (0/1/2...) mapped to human-readable names
- String target column support (
yes/no,hired/rejected,>50K/<=50K) - Real intersectionality via
compute_intersectionality()— every (col1 × col2) subgroup pair - Cells with fewer than 10 samples excluded and marked null to avoid misleading statistics
- Real Equalized Odds via
compute_eod()— true TPR/FPR difference per group /whatifendpoint — retrains model on reduced feature set, measures bias delta/whatif/featuresendpoint — returns available features from cached session- PDF audit report via ReportLab — verdict banner, metric scorecards, SHAP bars, AI explanation, regulation compliance table
- Single-page app with sidebar navigation and landing page
- Overview: score cards (DI, SPD, severity), approval rate chart, group comparison table
- Fairness metrics: metric bars, calibration curve, ROC by group — labeled with real group names
- Explainability: SHAP feature importance bars with proxy variable detection
- Intersectionality: real heatmap from backend + subgroup table ranked worst → best
- Remediation: before/after radar charts, recommended steps
- Audit report: structured findings + copy-to-clipboard + PDF download
- Demo presets: Hiring / Credit / Healthcare with one click
- Auto-detects target and sensitive columns from CSV headers
- Drag-and-drop CSV upload
- Audience toggle (NGO / Student / Policy maker)
- Regulation compliance pills (EEOC, EU AI Act, GDPR)
- What-if simulator: feature checkboxes, before/after radar, delta cards, AI explanation
- Audience toggle re-fetches explanation without re-uploading CSV
- Intersectionality: sample size tooltip on sparse cells
- Mobile responsive layout
- Loading skeletons instead of spinner
- Inline error messages instead of
alert()popups - Environment variable management for production (
.env→ Cloud Secrets)
MIT