📖 Project Story: FairLoan – Auditing AI for Bias in Mortgage Decisions
About the Project
🌟 Inspiration
The inspiration for FairLoan came from a simple but powerful question:
What if the algorithms that decide who gets a loan are unfair?
In the real world, access to credit can change lives, but it can also reinforce social inequalities if AI models are biased. As someone passionate about ethical AI, I wanted to build a system that not only predicts loan approvals, but also shines a light on hidden biases—so we can build a fairer future.
🛠️ How I Built It
Data Exploration:
I started by diving deep into the dataset, identifying protected attributes like Gender, Race, Income, Age, and Zip Code Group. I explored distributions, correlations, and potential sources of bias right from the start.Data Cleaning & Feature Engineering:
I handled missing values, encoded categorical variables, and engineered new features such as the income-to-loan ratio. To address class imbalance, I used SMOTE, ensuring that the model would not simply learn to favor the majority class.Modeling:
I chose a Random Forest classifier for its balance of interpretability and power, and tuned it for both accuracy and fairness. The model achieved an F1 score of 0.66 on validation data.Fairness Auditing:
Performance wasn’t enough. I used the Fairlearn library to audit the model’s predictions, calculating demographic parity difference, selection rates, and other group fairness metrics. I visualized these results with clear bar charts for each protected group.
đź’ˇ What I Learned
Bias is Everywhere:
Even with careful preprocessing, significant disparities can emerge. For example, males were approved at a much higher rate than females, and Black and Native American applicants had the lowest approval rates.Fairness is Multi-Dimensional:
Metrics like demographic parity and equalized odds can tell different stories. It’s important to look at the data from multiple angles.Transparency Matters:
Visualizing group disparities made the bias easy to see and communicate, which is crucial for both technical and non-technical audiences.
đźš§ Challenges Faced
Data Imbalance:
The dataset was imbalanced, with more denied than approved loans. Balancing the data without overfitting was a challenge.Complexity of Fairness Metrics:
Understanding and correctly implementing fairness metrics (and interpreting their results) required careful study and iteration.Reconciling Accuracy and Fairness:
Improving fairness sometimes meant sacrificing a bit of accuracy. Finding the right balance was a key challenge.Technical Hurdles:
Handling large, sparse datasets and ensuring the pipeline ran efficiently (especially with fairness libraries) took some troubleshooting.
🚀 What’s Next
- I’d like to explore advanced fairness mitigation techniques, such as reweighting or adversarial debiasing.
- Adding explainability tools like SHAP or LIME could help further demystify the model’s decisions.
- Ultimately, I hope this project inspires others to audit their own AI systems for fairness—because responsible AI is everyone’s responsibility.
Let’s build AI that’s not just smart, but also fair.
Log in or sign up for Devpost to join the conversation.