đź’ˇ Inspiration
Every day, millions of critical AI decisions are made—loan denials, medical diagnoses, resume screenings—with no understandable reason provided to the end user. We noticed that current explainability tools (like SHAP and LIME) output technical charts that non-engineers cannot interpret. As a result, users lose trust, domain experts ignore AI advice, and companies face regulatory pushback. We wanted to build a bridge between complex "black-box" models and human trust.
🔍 What it does
MindLens is an interactive "thought translator" that turns any black-box ML model's prediction into a human-readable explanation and tells the user exactly what to change to get a desired outcome. It tackles AI explainability through three pillars:
- Explain: It calculates SHAP values in real-time to identify which factors mattered most in the AI's decision.
- Prescribe: Interactive What-If sliders show exactly what features to change (and by how much) to flip a negative decision to a positive one.
- Validate: It uses K-Nearest Neighbors to look up similar historical cases, building trust through real-world precedent.
⚙️ How we built it
We designed a lightweight, highly modular architecture built entirely in Python:
- Frontend UI: We used Streamlit to rapidly build an interactive, data-driven application. We injected custom CSS to create a premium, glassmorphism-inspired Light Theme.
- Explainability Engine: We utilized SHAP (TreeExplainer) for industry-standard, mathematically robust feature attribution on a pre-trained
scikit-learnRandomForest model. - Narrative Engine: We integrated the Anthropic Claude 3.5 API to ingest the raw SHAP data and output empathetic, jargon-free explanations. (We also built a lightning-fast local templating engine as a fallback).
- Validation: We implemented
sklearn.NearestNeighborsto instantly query the dataset for the closest historical loan approvals and rejections.
⚠️ Challenges we ran into
One of the biggest hurdles was translating raw, abstract SHAP values into something a non-technical user could understand. SHAP values are inherently additive log-odds margins, which are mathematically sound but terrible for UX. We solved this by mapping every raw dataset feature to a human-friendly config file, and dynamically passing the top impact features into a Large Language Model (Claude) to generate a cohesive, conversational summary.
Another challenge was performance. Generating full LLM narratives for every slight movement of the "What-If" sliders resulted in high API latency. We mitigated this by mathematically calculating the probability delta on the fly and using a templated "counterfactual engine" for slider updates, ensuring <500ms UI updates.
🏆 Accomplishments that we're proud of
We are incredibly proud of the Counterfactual Engine. Most AI tools just tell you "You were rejected." MindLens actually tells you, "If you adjust your Loan Duration from 48 months to 12 months, your approval probability jumps by 40% and the decision flips." That level of actionable prescription turns AI from a gatekeeper into an advisor. We're also very proud of the UI/UX—it looks like a premium SaaS product built in under 24 hours.
📚 What we learned
We learned that the barrier to AI adoption isn't model accuracy; it's trust. By focusing on the user experience of the model output rather than just the model's F1 score, we discovered how much value lies in the "last mile" of Machine Learning delivery.
🚀 What's next for MindLens
We want to expand the platform to be completely model-agnostic via a drag-and-drop interface. Imagine a doctor uploading an XGBoost medical diagnosis model via a .pkl file, and MindLens instantly generating a dashboard that explains patient risk factors to them in plain English.
Built With
- anthropic-api
- pandas
- python
- scikit-learn
- shap
- streamlit
Log in or sign up for Devpost to join the conversation.