{"paper_id":"51a937b4-4f99-45bb-a87d-633b2b43310c","body_text":"Endometriosis is a debilitating, chronic disease, estimated to affect 11% of reproductive-age women [ 1 ]. While it is primarily characterized by the presence of endometrial-like tissue outside the uterus, it is a complex disease, involving multiple anatomical systems and sites [ 2 ,  3 ]. Diagnosis of endometriosis is difficult, with delays of up to 12 years reported [ 2 ]. Vague, nonspecific symptoms with multiple differential diagnoses contribute to this challenge. Misdiagnosis is common, with one study reporting 63% of affected women were told there was nothing wrong by at least one physician before ultimately receiving a diagnosis of endometriosis [ 4 ]. Additionally, the gold standard of diagnosis requires laparoscopic surgery—an invasive and potentially costly procedure [ 3 ,  5 ]. Long diagnostic delays can significantly impact the quality of life for affected women, leading to higher incidence of depression, reduced social activity, and increased healthcare costs [ 5 ]. Thus, earlier diagnosis and treatment are essential to improving the quality of life for these patients, especially by minimizing pain and treating infertility.\nPain is potentially an indicator of multiple health problems, not just endometriosis. Pelvic pain affects 80–98% of women with endometriosis [ 4 ,  6 ]; however, this common pain type manifests in several other disorders, including uterine fibroids, ovarian cysts, pelvic adhesions, and infectious diseases [ 7 – 12 ]. In some cases, chronic pelvic pain cannot be attributed to any clinical pathology, even after diagnostic laparoscopy [ 13 ]. Women with endometriosis often experience multiple types of pain, including dysmenorrhea (painful menstrual cramps), dyspareunia (pain with intercourse), chronic pelvic pain, dysuria (pain with urination), and dyschezia (pain with bowel movements) [ 14 ,  15 ]. Endometriosis-associated pain manifests in complex types, patterns, and intensities.\nIdentifying additional clinical indications of endometriosis holds promise for facilitating a shift from surgical diagnosis to less-invasive methods, decreasing the diagnostic delay without increasing the incidence of misdiagnosis [ 3 ]. Some previous studies examining pain in endometriosis have focused on types of pain [ 2 ,  16 ,  17 ]; in contrast, others have investigated possible relationships between anatomical locations of pain and the location of endometrial lesions although results were inconclusive [ 18 ,  19 ]. The dataset used in this study was previously analyzed with traditional statistical analysis techniques. The data contained meaningful associations; however, the granularity of the 155 anatomical pain sites made it difficult to interpret these preliminary results. Thus, further investigation with more advanced data science methods was warranted.\nThe objective for this study was to apply advanced data mining and artificial intelligence (AI) methods to delve deeper into the relationships between pain-related features, subfertility, and gynecological diagnoses, including endometriosis. We sought to demonstrate the capability of AI to perform analyses and discover associations that are more difficult to conduct using traditional statistical methods. This preliminary model was created to show the potential for AI to help expedite endometriosis diagnosis, using clinical factors in unsupervised clustering and Bayesian networks.\n\nData were previously collected from January 24, 2007, until August 7, 2009, as part of the ENDO (Endometriosis, Natural History, Diagnosis, and Outcomes) Study conducted in Salt Lake City, Utah, and San Francisco, California and described previously [ 1 ]. Institutional review board approval (Institutional Review Board, University of Utah) and written informed consent from all participants was obtained. The operative cohort included 473 women undergoing laparoscopy or laparotomy for various surgical indications, including pelvic pain (44%), pelvic mass (16%), irregular menses (13%), fibroids (10%), tubal ligation (10%) and infertility (7%). To prevent recall bias, women who had a prior surgical diagnosis of endometriosis were excluded. Women were also excluded if they were: pregnant, currently breastfeeding for 6 months or more, given injectable hormones within the past 2 years, or diagnosed with cancer other than non-melanoma skin cancer.\nSurgeons completed a standardized operative report immediately after surgery to capture gynecologic and pelvic pathology. Endometriosis was diagnosed using the clinical gold standard of surgically visualized disease [ 5 ,  20 ,  21 ] while its severity was based upon the revised American Society for Reproductive Medicine’s (rASRM) staging criteria [ 20 ]. We used the standardized operative form to assess endometriosis typology: superficial endometriosis, ovarian endometriomas, and deep infiltrating endometriosis [ 22 ].\nPrior to surgery, participants answered in-depth survey questions regarding their pain experiences. Women were asked whether they experienced pain lasting greater than 6 months that was either cyclic (i.e., painful menstrual cramps not relieved by over-the-counter medications) or chronic (i.e., pain located in or near the bladder or vaginal canal not associated with menses). They rated different sources of pain on an 11-point visual analog scale (VAS) with 0 denoting no pain to 10 denoting the most severe pain imaginable using a standardized questionnaire [ 23 ]. To evaluate subfertility, participants indicated if they had ever tried to get pregnant for more than 6 months or sought treatment for infertility. We discretized the responses to create the clinical features represented in  S1 Table . We determined the most appropriate pain threshold to dichotomize the data by identifying the pain threshold that maximized the specificity of the Bayesian network. Participants answered all questions, resulting in no missing data. Additionally, prior to surgery, participants indicated on a computerized anatomical map where they felt pain regularly. The VAS and anatomical map were adapted from the Pelvic Pain Assessment Form created by the International Pelvic Pain Society [ 24 ,  25 ].\nThe anatomical pain map comprised 155 total sites (60 front / 60 back / 35 perineal). We performed neighbor-joining (NJ) clustering to aggregate similar pain sites [ 26 ]. The NJ algorithm is an agglomerative, or bottom-up, clustering method that groups similar data points based on a given distance metric. We used the Jaccard distance metric to quantify similarities between sites [ 27 ]. We employed the commonly used “elbow” method to determine the appropriate number of clusters by plotting the number of clusters against a given threshold (the maximum distance separating the sites within each cluster) [ 28 ]. To perform NJ clustering, we used the R package DECIPHER, version 2.22.0 [ 29 ]. The neighbor-joining algorithm produced an unrooted, non-ultrametric tree. We used the threshold determined by the elbow method to create the clusters. To reduce extraneous variables, grouped anatomical locations where fewer than 5% of participants (N<25) indicated they felt pain were removed from further analysis.\nBayesian networks, a form of AI, are directed graphs that model conditional dependencies between variables [ 30 ,  31 ]. Each node in the network represents a variable with an attached conditional probability table, while each edge in the network represents a conditional dependency between nodes. Using these conditional dependencies and Bayesian inference, a query of the network can return the probability of an event conditioned upon the presence or absence of other variables in the network. Bayesian networks can model multiple dependencies between variables, account for non-additive risk propagation, and serve as a form of explainable AI [ 32 ].\nWe developed a Bayesian network using diagnoses and symptoms, including pain types (generated from the survey questions), pain locations (generated from the clustering), and subfertility. The structure of the network was learned from the data, using a hill-climbing algorithm, which iteratively improved the Bayesian Information Criterion (BIC) score until a local maxima was reached [ 33 ]. The conditional probability tables were learned from the data using Bayesian posterior estimation. We developed the network using the R package, bnlearn, version 4.7 [ 34 ]. For visualization as an undirected graph, the network was moralized. To moralize a network, an undirected edge was added between the parents of each node, after which all directional arrows were dropped [ 35 ].\nWe evaluated the performance of the network to predict diagnoses using sensitivity, specificity, and precision. The network was bootstrapped, and out-of-bag samples were used to calculate the performance metrics. We calculated the mean and 95% confidence intervals for the performance metrics after 1000 iterations of bootstrapping.\nWe evaluated the relative risk (RR) of a postoperative diagnosis, given the presence of a single symptom by querying the Bayesian network. To demonstrate the potential of the Bayesian network to model relationships between variables, we queried the network for the RR of a postoperative diagnosis, given multiple symptoms. The network was bootstrapped for 1000 iterations to obtain the mean and 95% confidence intervals for each RR. We calculated the RR using the R package, gRain, version 1.3.6 [ 35 ].\nTo compare the Bayesian network analysis with traditional statistical analysis, we evaluated the significance of pain-related features as they related to the postoperative diagnoses using Fisher’s exact test. We adjusted the p-values to control for the false discovery rate. We used Boschloo’s exact test to evaluate pairwise comparisons for any significant associations [ 36 ].\nTo further demonstrate the advantages of the Bayesian network, we performed an inverted analysis. We queried the net for the RR of subfertility given different diagnoses, defined as the risk of subfertility when a diagnosis is present compared to the risk of subfertility when no pathology is present.\nWe evaluated the ability of the Bayesian network to discriminate between rASRM stages, categorized as early-stage endometriosis (rASRM stages I and II) or late-stage endometriosis (rASRM stages III and IV), as well as endometriosis typology, categorized as superficial or deep infiltrating (DIE) and endometriomas [ 22 ]. We queried the net for the RR of a postoperative diagnosis as previously described. We used the independent samples t-test to evaluate if the RR between each stage or typology were significantly different. We adjusted the p-values to control for the false discovery rate.\n\nPostoperative diagnoses included: endometriosis (n = 190; 40.2%), normal pelvis (n = 122; 25.8%), uterine fibroids (n = 59; 12.5%), benign ovarian cysts (n = 52; 11.0%), and other gynecological pathologies (n = 50; 10.6% [pelvic adhesions (n = 37), congenital Müllerian anomalies (n = 10) and neoplasm (n = 3)]) [ 1 ].  S1 Fig  illustrates the distribution of VAS pain scores for each pain type.\nCollecting the pain data at a very granular level and then clustering pain locations based on participant responses enabled the grouping of pain locations. The elbow method determined 15 clusters with a threshold of 0.6375 as the maximum distance separating the sites within each cluster was optimal for this data ( S2 Fig ). A polar dendrogram visualizes the clustering in  S3 Fig . This data-driven approach generated clusters that nonuniformly divided the anatomical landscape. The clusters could be categorized in several ways, including singular (cluster 1—front of neck), discontinuous (cluster 12—front of both arms), encapsulated (cluster 2—urethra), asymmetrical (cluster 8—sternum and arm) or anteroposterior (clusters 3 and 4—abdomen and back) (see  Fig 1 ).\nColors on the anatomical map denote clustered locations of self-reported pain. The anatomical map used in the ENDO study was modified from the International Pelvic Pain Society.\nThe underlying anatomy could explain some of the apparent symmetry and asymmetry. For example, while cluster 7 (breasts) was symmetrical, clusters 6 and 9 (right and left epigastrium) were asymmetrical. This could be explained by the underlying anatomy of the abdomen, as the liver and gallbladder lie on the right side and the head of the pancreas and spleen on the left side. Clusters 5 (right hypochondrium and arm) and 8 (sternum and arm) were both non-contiguous and asymmetrical. Cluster 14 encompassed multiple non-contiguous sites, including the lower limbs, inner thighs, upper back, and waist. The elbow chart indicated this cluster included the least informative sites, as splitting this cluster would not result in much information gain.  S2 Table  describes the clusters.\nThe final Bayesian network, represented in  Fig 2 , included 18 nodes after pruning noninformative variables. For endometriosis diagnosis, the sensitivity of the network was 0.814 [95% CI 0.807, 0.821], the specificity was 0.421 [95% CI 0.413, 0.430], and the precision was 0.490 [95% CI 0.487, 0.493]. In the univariable analysis, the presence of any symptom, including chronic pelvic pain, subfertility, and dyspareunia, increased the RR of endometriosis (p-value < 0.001) ( Table 1 ).\nNodes correspond to pain-related features, subfertility, and diagnosis while the lines represent conditional dependencies between the features. Pain types are outlined in blue, while pain locations are outlined in pink. The color of the node indicates the proximity to the diagnosis node, including 1st, 2nd, 3rd, and 4th degree connections. The net has been moralized.\nThis table demonstrates univariable analysis with the Bayesian network. The numbers represent mean estimates of the relative risk (RR) of the specified diagnosis, i.e., endometriosis, uterine fibroids, benign ovarian cysts, other gynecological pathology, or a normal pelvis, given the presence of a single symptom with 95% confidence intervals shown in parentheses. Darker red denotes increased RR, while the darker blue denotes decreased RR. For the definition of RR, see  S4 Fig .\nAs shown in  Table 2 , the combination of multiple symptoms increased the RR of endometriosis while decreasing the RR of other diagnoses. However, the absence of subfertility decreased the RR of endometriosis and increased the RR of other diagnoses, most notably benign ovarian cysts.\nThis table demonstrates multivariable analysis with the Bayesian network. The numbers represent mean estimates of the relative risk (RR) of the specified diagnosis, i.e., endometriosis, uterine fibroids, benign ovarian cysts, other gynecological pathology, or a normal pelvis, given a combination of symptoms (presence or absence of a single or multiple symptoms) with 95% confidence intervals shown in parentheses. Darker red denotes increased RR, while the darker blue denotes decreased RR. For the definition of RR, see  S5 Fig .\nA web application to explore and query the Bayesian network is deployed to a public server: amber-kiser.shinyapps.io/ENDO-pain-app. We developed and deployed the application using the R package shiny, version 1.7.1 [ 37 ]. The  S7 – S10  Figs contain screenshots and instructions for how to access the application.\nThe first sensitivity analysis allowed us to compare the performance of our Bayesian network against a more traditional statistical method, Fisher’s exact test, used in previous studies of endometriosis [ 23 ]. Fisher’s exact test identified nine clinical features significantly associated with endometriosis, including dysmenorrhea, dyspareunia, chronic pelvic pain, subfertility, ovulation pain, pain in epigastrium (Cluster 6), dyschezia, pain in sternum (Cluster 8), and pain in subscapular region (Cluster 11).  S3 Table  provides the full results from Fisher’s exact test and Boschloo’s exact test for pairwise comparisons.\nIn the second sensitivity analysis, we performed an inverted analysis, where the diagnoses and symptoms were reversed, to further demonstrate the advantages of using a Bayesian network. We found that the RR of subfertility was highest with a diagnosis of endometriosis. The RR of subfertility was most decreased when a normal pelvis was present; however, having a diagnosis of benign ovarian cysts or uterine fibroids decreased the RR of subfertility. The results are illustrated in the forest plot in  S6 Fig .\nIn our final sensitivity analysis, we evaluated the ability of the net to discriminate between rASRM stage and endometriosis typology. Results are presented in  S4  and  S5  Tables. The RRs for early-stage endometriosis were statistically different from the RRs for late-stage endometriosis in 8 out of 17 cases. The RRs for superficial endometriosis were statistically different from the RR for DIE or endometriomas in 16 out of 17 cases. This demonstrates the potential for discrimination between stages or typology. However, more data from each category would be required to develop a network for this purpose.\n\nWe used a combined approach of clustering and Bayesian networks to demonstrate the power of AI to discover associations between pain-related features, subfertility, and endometriosis. The network identified the transitive relationships between postoperative diagnoses and pain-related features (Tables  1  and  2 ). The presence of any pain increased the RR of endometriosis compared with benign ovarian cysts, uterine fibroids, other gynecological pathology, or a normal pelvis.\nTo date, several studies have focused on the relationship between pain and diagnosis, but relatively few have tried to understand how specific anatomical locations and types of pain combine to forecast endometriosis. The few studies incorporating anatomical locations of pain have usually attempted to relate pain to endometrial lesion location with inconclusive results [ 18 ,  19 ]. In 2010, Ballard et al. conducted a study of women with chronic pelvic pain to evaluate how specific symptoms and descriptions of pain can facilitate endometriosis diagnosis [ 38 ]. They included an anatomical pain map and grouped 100 sites into 15 areas, although no description was provided of how this grouping was determined. None of the anatomical areas of pain were significantly associated with endometriosis in their study, as women with endometriosis and women with a normal pelvis felt pain indiscriminately.\nIn our study, we saw a similar trend for some pain locations. While a higher number of women with endometriosis reported pain in the lower abdominal and pelvic region (61.6%), half of the women with a normal pelvis also reported pain in these regions. Despite this, with our Bayesian network analysis, we demonstrated that pain in certain anatomical locations can significantly increase the RR of endometriosis. We found that the combination of specific anatomical locations of pain with specific types of pain enables greater diagnostic discrimination.\nThe Bayesian network identified pain in the epigastrium, subscapular region, sternum, and right hypochondrium as significant for an endometriosis diagnosis. While previous literature has not associated these pain locations with pelvic endometriosis, pain in comparable locations has been reported in thoracic or diaphragmatic endometriosis [ 39 – 42 ]. Piccus et al. found that diaphragmatic endometriosis patients reported pain in the chest, upper abdomen, shoulder, and upper back [ 43 ]. Other reports describe diaphragmatic endometriosis in patients with right chest, shoulder, and hypochondrium pain [ 44 ,  45 ]. Pain in the epigastrium, subscapular region, sternum, and right hypochondrium could accelerate the diagnosis by indicating potential extrapelvic endometriosis; however, this finding will need to be validated in future research.\nThe symptoms of endometriosis, including dyschezia and abdominal pain, are also common to irritable bowel syndrome (IBS) and constipation. Several studies have shown an association between endometriosis and IBS [ 14 ,  46 ]. However, it is not known if this association is due to misdiagnosis or a true comorbidity. Dyschezia was an important pain type in our study as it was associated with an increased RR of endometriosis and significantly associated with endometriosis in the sensitivity analysis. Future studies can potentially differentiate endometriosis from IBS or other conditions like fibromyalgia, interstitial cystitis, and myofascial pain.\nIn the first sensitivity analysis, we compared the features significantly associated with endometriosis using Fisher’s exact test and the Bayesian network. When comparing these results, the nine features identified as significant in Fisher’s exact test increased the RR of endometriosis in the Bayesian network. However, we also identified other features, including abdominal pain, dysuria, and pain in the right hypochondrium that increased the RR of endometriosis when included in the Bayesian network, but were not significant in Fisher’s exact test. These results demonstrate the ability of the net to uncover previously undetected relationships that would be considered insignificant in our data using traditional statistical methods.\nFurther evidence of the benefits of an AI-based analysis was demonstrated in the multivariable analysis ( Table 2 ). Combining multiple pain-related features and subfertility added discrimination power, allowing the Bayesian network to differentiate between endometriosis and other diagnoses. This multivariable analysis would be more difficult to perform using traditional statistical methods as it is much harder to consider the combined contributions of several variables, especially when those are not necessarily additive.\nPrior uses of graphical models and Bayesian networks in endometriosis research include investigations of risk factors and treatment efficacy [ 47 – 49 ]. However, we are aware of no other studies that have implemented Bayesian networks to evaluate pain-related features of endometriosis, as most have used logistic regression to investigate clinical features of endometriosis. Unlike regression-based models, Bayesian networks can be used for univariable or multivariable analysis while considering the relationships between variables, and importantly they are explainable and handle missing data [ 32 ].\nWe acknowledge that our study has limitations. While we tried avoiding bias in the study population, we only included women who were undergoing laparoscopy or laparotomy for a surgical indication, potentially excluding some asymptomatic women. The study population was predominantly white, well-educated women with access to healthcare. In future studies, we could use additional, external, and more diverse data to validate these results. External validation using large, heterogeneous data will be vital prior to clinical implementation. Future studies could explore factors that mediate pain experiences, including pain medications and psychological conditions, like anxiety and depression. Pain duration as well as pain description (i.e., sharp, dull, radiating) are potentially important variables to include in future studies along with family history of endometriosis and response to previous hormonal treatment. With additional data, we could investigate comorbidities that may alter pain presentation in endometriosis, including irritable bowel syndrome and constipation.\n\nClustering anatomical pain sites and developing a Bayesian network, a form of AI, to study pain-related features of endometriosis demonstrated that combining specific pain locations with pain types may be useful for the diagnosis of endometriosis. We demonstrated that differing combinations of pain-related features resulted in differing RRs among women with endometriosis, benign ovarian cysts, uterine fibroids, other gynecological pathology, and a normal pelvis. These results suggest the use of AI can provide novel insights. We built a prototype web application to demonstrate the potential of the Bayesian network to assist in diagnosis after external validation. A recent qualitative study of endometriosis-related pain suggested that looking beyond cyclical pain to other pain experiences may lead to faster diagnosis and more effective treatment [ 15 ]. Our Bayesian network, incorporating a variety of pain-related features of endometriosis, advances this goal.\n\nThese questions were used to determine the presence of specific clinical features in participants of the ENDO study. (Buck Louis GM, Hediger ML, Peterson CM, et al. Incidence of endometriosis by study population and diagnostic method: the ENDO study. Fertil Steril. 2011;96(2):360–365).\n(PDF)\nClusters were grouped as described in the methods. Location lists the anatomical sites included in each cluster. Asterisks in the Custer ID column denote clusters with N<25 participants.\n(PDF)\nThis table presents a univariate analysis done with traditional statistical techniques. Significant differences were assessed using Fisher’s Exact Test. P-value adjusted for the false discovery rate. Pairwise comparisons for any significant associations were evaluated with Boschloo’s Exact Test.  a,b,c,d,e,f Significantly different pairwise values p-value < 0.05.\n(PDF)\nFor the definition of relative risk (RR), see  S4 Fig . Mean estimates with 95% confidence intervals are shown in parentheses. Significant differences were assessed using the independent samples t-test. P-value adjusted for the false discovery rate. * p-value < 0.05; *** p-value < 0.001.\n(PDF)\nFor the definition of relative risk (RR), see  S4 Fig . Mean estimates with 95% confidence intervals are shown in parentheses. Significant differences were assessed using the independent samples t-test. P-value adjusted for the false discovery rate. * p-value < 0.05; *** p-value < 0.001.\n(PDF)\nThe distribution of VAS pain scores for each pain type. We determined a pain threshold of 1 was most appropriate for dichotomization of pain scores (see  S1 Table ).\n(TIF)\nThe elbow method requires identifying the point in the chart where a sharp bend, or “elbow,” occurs. This is determined to be the optimal number of clusters that are informative. The threshold represents the maximum distance separating sites within each cluster. In this chart, an elbow can be identified at 15 clusters, corresponding to a threshold of 0.6375.\n(TIF)\nThe neighbor-joining algorithm produced an unrooted tree. For visualization as a dendrogram, this tree has been rooted at the midpoint.\n(TIF)\n(A) When evaluating the relative risk given a single pain-related feature, relative risk is defined as the absolute risk of having a diagnosis given the presence of a pain type or location compared to the absolute risk of having a diagnosis given the absence of a pain type or location. (B) For example, the relative risk of endometriosis when dyspareunia is present is calculated from the absolute risk of endometriosis when dyspareunia is present divided by the absolute risk of endometriosis when dyspareunia is absent.\n(TIF)\n(A) When evaluating the relative risk in the presence or absence of multiple pain-related features, relative risk is defined as the absolute risk of having a diagnosis given the presence or absence of a pain type or location compared to the absolute risk of having a diagnosis given the opposite condition(s). (B) For example, the relative risk of endometriosis when pain in the epigastrium and dyspareunia are present and subfertility is absent is calculated from the absolute risk of endometriosis when pain in the epigastrium and dyspareunia are present and subfertility is absent divided by the absolute risk of endometriosis when pain in the epigastrium and dyspareunia are absent and subfertility is present.\n(TIF)\nRelative risk of subfertility given a specific diagnosis. This forest plot illustrates the relative risk of subfertility, defined as the absolute risk of subfertility when a specific diagnosis is present compared to the absolute risk of subfertility when a specific diagnosis is absent. Error bars represent the 95% confidence intervals. Values to the right of the dotted line indicate an increased relative risk, whereas values to the left indicate a decreased relative risk.\n(TIF)\nThe Bayes Net Explorer app visualizes the calculated Bayesian network and allows users to run any combination of queries, accessible at amber-kiser.shinyapps.io/ENDO-pain-app.\n(TIF)\nThe probability and relative risk of postoperative diagnoses are returned, given the presence of ovulation pain.\n(TIF)\nThe probability and relative risk of postoperative diagnoses are returned, given the presence of ovulation pain and absence of subfertility.\n(TIF)\nThe probability and relative risk of subfertility is returned, given the presence of an endometriosis diagnosis, dyspareunia, and chronic pelvic pain.\n(TIF)","source_license":"CC0","license_restricted":false}