← Back to Portfolio

Case Study

FairLens

AI-powered bias and fairness analysis tool

FairLens helps analyze datasets and model outputs for possible unfairness by comparing outcomes across sensitive attributes and generating AI-assisted explanations.

Role Full-stack Developer
Stack FastAPI, Python, Next.js/React, Gemini API
Type AI / Fairness Analysis MVP
Status MVP / Prototype

Making fairness analysis easier to inspect.

What it does

FairLens lets users inspect datasets or model outputs for group-wise outcome differences.

Why it was built

It was built as an MVP to make bias checks more approachable for small teams and learners.

Who it helps

It is useful for students, developers, and early-stage teams exploring fairness in ML tools.

Bias can be hard to see until outcomes are compared clearly.

ML systems can produce unfair outcomes when different groups receive different results.

Many beginners and small teams do not have an easy way to inspect bias in datasets or predictions.

FairLens was built as a simple MVP to make fairness analysis more understandable.

Full-stack work across analysis, validation, charts, and AI insights.

Backend fairness analysis flow
Frontend form and validation logic
Dataset/model mode handling
Chart-based result visualization
AI-generated insight integration
Error handling and UX improvements

Focused tools for beginner-friendly fairness inspection.

Upload / demo dataset analysis

Users can bring their own CSV or try the flow with a demo dataset.

Sensitive attribute selection

The UI guides users to choose the group attribute used for comparison.

Target and prediction handling

Target and optional prediction columns define the analysis mode.

Selection-rate metrics

The backend computes group-wise rates to make outcome differences visible.

Bias visualization charts

Charts turn the computed metrics into easier-to-scan comparisons.

AI-generated explanation

Gemini-assisted summaries explain what the results may suggest.

Beginner-friendly results

The output is written for clarity instead of assuming ML expertise.

A clear flow from dataset choice to explainable results.

1User selects dataset or demo
2User chooses target column and sensitive attribute
3Optional prediction column determines dataset mode vs model mode
4Backend computes group-wise selection rates and compares disparities across sensitive groups to highlight potential bias.
5Frontend renders charts and summaries
6Gemini API generates structured insights

A high-level overview of how FairLens processes datasets and generates explainable fairness insights.

The architecture combines a Next.js frontend, FastAPI backend, fairness analysis engine, and Gemini-powered explanation pipeline.

FairLens system architecture diagram showing dataset processing, fairness analysis, and explainable insight generation.

Small product decisions made the MVP clearer and more reliable.

Challenge

Invalid column combinations

Fix

Added validation for target, sensitive, and prediction columns.

Challenge

Prediction column confusion

Fix

Made prediction optional and handled dataset vs model mode clearly.

Challenge

AI insight failures

Fix

Added fallback messages and improved timeout/model configuration.

Challenge

Chart edge cases

Fix

Handled all-zero and single-group scenarios.

Challenge

Deployment fetch issues

Fix

Documented frontend/backend integration limitations.

Designing AI tools for clarity, not just features.

  • How fairness metrics can be made understandable through UI.
  • Importance of validation before analysis.
  • Difference between dataset-level and model-level bias analysis.
  • Handling unreliable AI responses gracefully.
  • Designing AI tools for clarity, not just features.

Where FairLens could grow next.

  • Expand advanced fairness metrics
  • Make reports more actionable (not just downloadable)
  • Add model-to-model comparison
  • Improve real-time user guidance
  • Enhance chart explanations & insights

Back to the full project collection.

Back to Projects