Inspiration

Recommendation systems shape what billions of users see every day — but they can also amplify popularity bias and silence niche creators. We noticed platforms often surface the same top items repeatedly, which reduces content diversity and unfairly disadvantages smaller creators and under-represented content. That motivated us to build Fair AI for Social Platforms: a practical system that keeps recommendations relevant while actively reducing exposure bias so more voices can be discovered.

What it does

Scenario: Imagine a social feed or content discovery page that not only shows what you’re likely to enjoy, but also ensures creators and content categories receive fair exposure. Fair AI for Social Platforms produces ranked lists that balance relevance with exposure fairness, and lets operators (or end users) tune the fairness–utility trade-off. Feature Overview:

  • Two-stage recommender: candidate generation (SVD / embeddings) → fairness-aware re-ranking.
  • Fairness re-ranker: greedy exposure-penalty algorithm that enforces proportional/equal exposure or fixed quotas.
  • Metrics dashboard: Precision, Recall, NDCG, exposure shares, and L1 disparity to quantify trade-offs.
  • Interactive demo: slider for fairness λ, per-user feed view, and visualization of before/after exposure distributions.
  • Modes supported: proportional (pool-based), equal (equal exposure), fixed_target (global catalog target), and min_quota (guaranteed diversity).
  • Reproducible experiments: dataset download + evaluation pipeline + saved results/plots.

How we built it

Data:

  • Dataset (prototype): MovieLens ml-latest-small (100k ratings) used as a stand-in for content interactions.
  • Preprocessing: convert explicit ratings → implicit likes; compute item popularity to define HEAD vs TAIL groups. Provide optional genre-based groups for multi-attribute fairness. Algorithm:
  • Baseline candidate generation: Surprise SVD (matrix factorization) to score unseen items per user and produce top-N candidates.
  • Fairness re-ranker: position-weighted greedy algorithm: -Compute a target exposure distribution (proportional, equal, or fixed).
  • For each rank position, pick the candidate maximizing score - λ * fairness_penalty.
  • Evaluation: Precision, Recall, NDCG, exposure shares (position-weighted), and L1 disparity to quantify distance from target exposure. Tech stack:
  • Backend: Python, Pandas, NumPy
  • Recommender: surprise (SVD)
  • Fairness logic & metrics: custom Python modules (src/fairness.py, src/metrics.py)
  • Demo & visualization: Matplotlib for plots; Streamlit for local interactive demo; Gradio for quick sharing if needed
  • Reproducibility: Colab notebook + saved CSV/PNG outputs, requirements.txt for environment Development process:
  • Modular repo: src/ modules for data, baseline, fairness, metrics, evaluation; app.py for demo; notebooks for experiments.
  • Iterative tuning: λ sweeps to produce a Pareto frontier of NDCG vs disparity and identify operational sweet spots.

Challenges we ran into

  • Trade-off balancing: Reducing disparity can lower standard relevance metrics. Designing an interpretable penalty and showing empirical trade-offs (λ sweep) was key to justify choices.
  • Demo UX vs. backend latency: Re-ranking per user is cheap for small pools but needs careful batching for production. We designed the pipeline for offline candidate generation + lightweight online re-rank.
  • Simulated sensitive attributes: MovieLens doesn’t contain demographic attributes; we used popularity/genre proxies and documented limitations and ethical implications.
  • Time & scope constraints: Building an end-to-end demo, evaluation pipeline, and a polished UI in hackathon time required prioritizing modular, testable components over ambitious in-processing model changes.

Accomplishments that we're proud of

  • End-to-end prototype: Data ingestion → SVD baseline → fairness re-ranker → metrics → interactive demo.
  • Clear fairness controls: Implemented multiple practical modes (equal, proportional, fixed target) and a guaranteed quota mechanism to produce demonstrable fairness improvements.
  • Quantified trade-offs: Produced λ sweeps and trade-off plots showing how small accuracy degradation can yield significant exposure gains for under-represented items.
  • Reproducibility: Packaged scripts and Colab-ready notebook that reproduce experiments and save CSV/PNG outputs for evaluation and submission.
  • Demo-ready UI: Streamlit app allowing judges to interactively adjust fairness λ and quotas, inspect per-user lists, and view exposure statistics.

What we learned

  • Algorithmic and product insights: Simple post-processing re-ranking is a practical and interpretable method for operational fairness — it’s fast, explainable, and integrates easily into existing pipelines.
  • Trade-offs are real but manageable: A small, well-chosen fairness penalty can meaningfully decrease exposure disparity with only modest drops in NDCG/precision.
  • Importance of clear targets: The choice of target exposure (per-pool vs. global vs. equal) dramatically affects outcomes and must be justified depending on business goals.
  • Value of experimentation & visualization: Presenting empirical trade-offs (numbers + charts) is essential to convince stakeholders; sliders and live plots make the argument tangible.
  • Team & process: Modular code and a reproducible pipeline speed up iteration and make it easier to demo and explain under time pressure.

What's next for Fair AI for Social Platforms

Polish UI (per-user fairness slider, Gradio share), scale candidate generation with FAISS, experiment with in-processing fairness (fairness regularizer), and add continuous monitoring/audit exports for deployment.

Built With

Share this project:

Updates