BackgroundMedical students frequently experience heightened levels of anxiety, depression, and burnout. These challenges are disproportionately borne by students from underrepresented backgrounds, who are exposed to systemic inequities, discrimination, and reduced access to supportive resources. While precision well-being approaches, characterized by identifying distinct well-being phenotypes for personalized interventions, hold promise, standard machine learning clustering algorithms such as K-Means may inadvertently exacerbate these disparities. Furthermore, the underlying factors contributing to poorer mental health outcomes among underrepresented students remain insufficiently understood.ObjectiveWe aim to identify well-being phenotypes that achieve an equitable distribution of clustering costs across racial groups, identify conditions under which fair and standard clustering solutions converge, and investigate the demographic and socioeconomic factors that shape mental health patterns in students underrepresented in medicine.MethodsDrawing on a diverse sample of 4161 medical students from multiple U.S. institutions participating in the Healthy Minds Survey (2016–2021), we compared the outcomes of socially fair and standard k-Means clustering algorithms using Patient Health Questionnaire-9, General Anxiety Disorder-7, and Flourishing scores. We then employed average treatment effect analyses to identify factors that exacerbate mental health challenges and those that enhance resilience, with a particular emphasis on underrepresented populations.ResultsThe socially fair clustering algorithm significantly reduced the disproportionate burden on minority populations, aligning with standard clustering outcomes when student groups were racially and socioeconomically homogeneous. Perceived discrimination emerged as a key factor driving poorer mental health, while stable financial conditions, robust social engagement, and involvement in culturally or ethnically oriented organizations were linked to greater resilience and improved well-being.ConclusionsIncorporating fairness objectives into clustering algorithms substantially reduced the disproportionate burden on minority students and yielded a more equitable understanding of their mental health patterns. By identifying factors that influence mental health outcomes, our socially-fair precision well-being approach allows for more personalized well-being interventions. These insights equip educators and policymakers with actionable targets for developing culturally responsive, data-driven interventions that not only alleviate distress but also support resilience, ultimately advancing more inclusive, effective precision well-being strategies for all medical students.