Melasma management is challenged by heterogeneity in patient presentation, particularly among individuals with darker skin tones. This study applied k-Means clustering to identify patient subgroups that could inform precision treatment approaches. We analysed clinical and demographic data from 150 South African women with melasma using k-Means clustering. The optimal number of clusters was determined using the Elbow Method and Bayesian Information Criterion (BIC), with t-SNE visualization for validation. The k-Means algorithm identified seven distinct patient clusters explaining 52.6% of data variability (R²=0.526), with model evaluation metrics including BIC=951.630 indicating optimal model fit and a Silhouette Score of 0.200 suggesting moderate cluster separation, while the Calinski-Harabasz index of 26.422 confirmed relatively well-defined clusters that were characterized by distinct profiles including "The Moderately Sun Exposed Young Women," "Elderly Women with Long-Term Melasma," and "Younger Women with Severe Melasma," with key differentiators being age distribution and menopausal status, melasma severity and duration patterns, sun exposure behaviours, and quality of life impact profiles that collectively define the unique clinical characteristics of each subgroup.
This study demonstrates how machine learning can identify clinically relevant patient subgroups in melasma. Aligning interventions with the characteristics of specific clusters can potentially improve treatment efficacy.