EqualCare is a web application that helps identify gender bias in healthcare datasets before they are used in machine learning models or clinical research. It provides a simple upload interface for researchers and developers to analyze their datasets for gender representation imbalance, and offers AI-powered insights on how such imbalance could impact real-world outcomes.
- Upload CSV datasets securely
- Automatically detect and normalize gender data
- Calculate gender breakdown and bias levels
- Visualize data distributions (bar/pie chart support coming soon)
- Generate plain-English explanations for detected bias using RAG (retrieval-augmented generation)
- Maintain a history of uploaded files
- Supports structured output with
issue
,impact
, andsolution
sections
- Frontend: React (JavaScript)
- Backend: FastAPI (Python)
- Data Analysis: Pandas
- AI Inference: OpenRouter API (OpenChat 7B via RAG)
- Embeddings: SentenceTransformer (
all-MiniLM-L6-v2
) - Vector DB: ChromaDB
- Storage: Supabase (buckets)
- PDF Loader: LangChain Community (PyPDFLoader)
- Users upload a CSV file containing healthcare data.
- The backend processes the data using Pandas, normalizing gender values and analyzing imbalance.
- A bias level is computed based on percentage thresholds.
- The app performs a vector similarity search on related research papers.
- It sends a structured prompt to a hosted LLM via OpenRouter to generate:
- Issue: What the imbalance is
- Impact: Why it matters in real-world contexts
- Solution: How to address or mitigate it
- The frontend displays the breakdown and AI-generated explanation.
git clone https://github.com/your-username/equalcare.git
cd equalcare
- Create and activate a virtual environment
- Install dependencies
pip install -r requirements.txt
- Create a
.env
file with the following keys:
OPENROUTER_API_KEY=your_openrouter_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_service_role_key
SUPABASE_BUCKET=your_supabase_bucket_name
- Start the server:
uvicorn main:app --reload
cd frontend
npm install
npm run dev
To build for production:
npm run build
For deployment as a unified full-stack app:
- Build the React frontend (
npm run build
) - Serve the
/dist
folder with FastAPI usingStaticFiles
- Configure environment variables in your deployment environment
- Optional: Use Docker for containerized deployment
/frontend # React frontend app
/backend # FastAPI backend (main app.py lives here)
/research_papers # PDF docs used for RAG vector store
/chroma_db # ChromaDB persistent vector DB
- Add charting (bar/pie visualization of gender distribution)
- Add auto-detection of dataset categories (e.g., Stroke, Heart Attack)
- Expand AI reasoning to support multiple bias types
- Support multi-class gender labels
- PDF export or report download
This project is open-source and available under the MIT License.