{"paper_id":"d96340ce-d2f7-46df-8818-8856c3e0ac99","body_text":"Deep Learning Improves Accuracy of Laparoscopic  \nImaging Classification for Endometriosis Diagnosis\nResearch Article\nJournal of \nClinical & Medical Surgery\nReceived: Dec 13, 2023\nAccepted: Feb 05, 2024\nPublished: Feb 12, 2024\nArchived: www.jclinmedsurgery.com\nCopyright: © Constantinos K (2024).\nwww.jclinmedsurgery.com\nArticle Information*Corresponding Author: Koutsojannis Constantinos\nDepartment of Physiotherapy, Health Physics and Compu-\ntational Intelligence Lab, University of Patras, Greece.  \nEmail: ckoutsog@upatras.gr\nwww.jclinmedsurgery.com\nISSN 2833-5465\nOpen Access\nVolume 4\nAbstract\nPurpose: The purpose of this research was the development and evaluation of an intelligent assis -\ntive classification system for the recognition of endometriosis and the improvement of the accuracy of \nlaparoscopic imaging in diagnosis. The research was developed with the use of deep learning approaches.\nMethods: Data from 4448 laparoscopy images were used in a retrospective chart analysis. The data \nwere divided into two folders, healthy and pathological including 2157 healthy and 2291 pathological im-\nages. Based on simple clinical and imaging information and criteria such as the diagnosis of endometriosis \n(included in an open-source dataset GLENDA of Kaggle repository), data mining algorithms were used to \nimprove laparoscopic imaging accuracy.\nResults: The final developed computer system based on the ResNet50 algorithm predicted the best \noutcome for all participants who had laparoscopic surgical therapy. The Keras tool was used and the \ngenerated code was implemented in Python programming language providing a mean accuracy of >95%.\nConclusion: The intelligent approach revealed better performance than the commonly used imaging \ncriteria in predicting endometriosis improving the time and the total accuracy of diagnostic approaches. \nNifora Chrysa; Chasapi Lamprini; Chasapi Maria-Konstantina; Koutsojannis Constantinos*\nDepartment of Physiotherapy, Health Physics and Computational Intelligence Lab, University of Patras, Greece.\nKeywords: Laparoscopic; Endometriosis; Keras; Python; Deep learning.\nIntroduction\nEndometriosis is a common problem in women. Its name \ncomes from the word “endometrium”, meaning the thin in -\nner lining of the uterus [1]. It is the growth of tissue usually \nfound in the inner lining of the uterus (endometrium) in a lo -\ncation outside the uterine cavity. With the changing hormone \nlevels during the menstrual cycle, the tissue can grow and/or \nbreak down, leading to the development of pathological tissue \n- referred to as scarring - and eventually abnormally high lev -\nels of pain. It can occur in the ovaries, fallopian tubes, behind \nthe uterus, in the tissues that hold the uterus in place, in the \nintestine, abdominal wall, or other organs, i.e. in other areas \nof the body where it does not normally belong [2]. Other loca -\ntions where endometriosis can develop are the vagina, cervix, \nvulva, or even the bladder [1,2]. Endometriosis has multiple ap-\npearances, and the lesions may be confused with other non-\nendometriotic lesions, as well as endometriotic lesions that are \nnonendometriotic by appearance or deep infiltrating ones that \nmay be missed on visual diagnosis. How often endometriosis \noccurs in women cannot be accurately determined, as the di -\nagnosis is usually made only by direct visualization of the en -\ndometrial tissue (which requires a surgical procedure, typically \na laparoscopy) [3]. It is estimated, however, that approximately \n6 to 10% of all women suffer from endometriosis. The percent-\nage of women who have endometriosis is higher among women \nwho are infertile (25 to 50%) and women who have pelvic pain \n(75 to 80%). The average age at diagnosis is 27, but it can also \ndevelop in adolescence. According to studies, in the United \n\nwww.jclinmedsurgery.com              2\nKoutsojannis Constantinos\nCitation: Chrysa N, Lamprini C, Konstantina CM, Constantinos K. Deep Learning Improves Accuracy of Laparoscopic Imag-\ning Classification for Endometriosis Diagnosis. J Clin Med Surgery. 2024; 4(1): 1137.\nStates of America, more than 5 million women are faced with \nthe problem of endometriosis. In a survey that was conduct -\ned, on 96 women it was observed that using histopathology as \nthe gold standard, sensitivity for laparoscopic visualization was \n90.1% (95% CI: 81.0-95.1), while specificity was 40.0% (95% CI \n23.4-59.3). Positive and negative predictive values were 81.0% \n(95% CI: 71.0-88.1) and 58.8% (95% CI: 36.0-78.4), respectively; \nand the accuracy was 77.1% (95% CI: 67.7-84.4) [4]. Laparos -\ncopy is the minimally invasive method a doctor can use to see \nif there are areas of endometriosis. The endoscope is inserted \ninto the abdominal cavity through a small incision most often \nmade just above or below the belly button. It is the only safe \nway to know for sure that you have endometriosis. If it is not \nclear whether the detected tissue is normal or endometrial, a \nsample of the tissue is taken for biopsy. Depending on the loca-\ntion of the tissue, taking a sample for biopsy can be done en -\ndoscopically through the anus (sigmoidoscopy) or the bladder \n(cystoscopy) [1-3,5]. Based on the findings of laparoscopy [4], \nstages of severity of the disease can be distinguished. Staging is \njudged according to the number of foci, their size and depth, the \npresence of adhesions, and the presence of endometriomas. \nThe most severe stages require radical surgical treatment [6]. \nFor most women with moderate to severe endometriosis, the \nmost effective treatment is surgical removal or destruction of \nthe endometrial tissue. In the past, endometriosis was treated \nwith open surgery, which involved a large incision. Now, how -\never, it has prevailed that the surgery is performed with laparo-\nscopic surgery or with its evolution, robotic surgery, to achieve \nthe optimal medical result with the least possible tissue injury. \nLaparoscopic endometriosis repair is a minimally invasive pro -\ncedure that involves not a large incision, like traditional open \nsurgeries, but [3,4] very small holes in the patient’s abdomen, \nthrough which laparoscopic instruments are inserted. Among \nthem is the laparoscope, which includes a camera that offers \nthe surgeon an extremely sharp image. This allows him to inves-\ntigate all foci of endometriosis, minimizing injury to neighboring \ntissues and organs [1,7-9]. Through laparoscopy, medical video \nfiles can be created, for post-operative analysis. This enables \nphysicians to review interventions at any time to gain useful \ninsights or improve treatment planning and medical education \n[10]. Computer-aided automatic content analysis can be em -\nployed for creating systems that highlight potentially relevant \ncontent to physicians during patient case inspections (Figure 1). \nHowever, although obvious irrelevant video segments such as \noverly blurry frames or camera testing screens can reasonably \nbe identified via video analysis, more sophisticated approaches \nare required for identifying very specific content such as scenes \nshowing endometriosis lesions [11].\nThe best-known classification system for endometriosis \nis the revised American Society for Reproductive Medicine \n(rASRM) score and the Enzian classification scheme [12,13]. \nThe rASRM score describes superficial lesions of the peritone -\num and ovarian endometriosis in four stages, whereas the En-\nzian classification categorizes deep endometriosis. Alongside \nthese different possible locations, endometriotic lesions also \nstrongly vary in their visual appearance, both intra and inter -\npersonal. The rASRM score describes superficial lesions of the \nperitoneum and ovarian endometriosis in four stages, whereas \nthe Enzian classification categorizes deep endometriosis. In di-\nrect comparison and without a specific medical background, \nthe differences between normal and pathological tissue are \nvery difficult to discern, which evidently holds true for laymen \nbut even inexperienced medical practitioners. Consequently, \nwith the current successful application of deep learning in many \nmedical fields, attempting to solve this problem via computer-\naided analysis seems reasonable. Moreover, being able to clas-\nsify and potentially locate endometriosis can not only be helpful \nduring interventions but also in treatment planning and particu-\nlarly in teaching/training. The purpose of this research is the \ndevelopment and evaluation of an intelligent assistive classifi -\ncation system for the recognition of endometriosis and the im-\nprovement of the accuracy of laparoscopic imaging in diagnosis. \nThe research was developed with the use of deep learning ap -\nproaches. By revising the labeling strategy of the publicly avail-\nable endometriosis dataset GLENDA towards visual similarity, \nwe discover a large improvement in lesion segmentation per -\nformance. Data from 4448 laparoscopy images were used [14]. \nBased on simple clinical and imaging information and criteria \nsuch as the diagnosis of endometriosis (included in an open \nsource dataset Glenda of repository Kaggle), data mining algo -\nrithms were used to improve laparoscopic imaging accuracy. \nThe final developed computer system based on the ResNet50 \nalgorithm predicted the best outcome for all participants who \nhad laparoscopic surgical therapy. The Keras tool was used and \nthe generated code was implemented in Python language.\nRelated work: Laparoscopy is a minimally invasive procedure \noften alongside histopathological confirmation for diagnos -\ning all types of pelvic endometriosis (ovarian endometriomas, \nDE, SE) since surgeons can directly visualize the pelvic and ab -\ndominal cavity. In 2022, ESHRE no longer considered laparos -\ncopy as the “gold standard” and recommends its use if initial \nimaging results are negative and/or patients are not suitable/\nunresponsive to empirical treatment [15]. Depending on the \ngoal, during the same operation, surgeons could also aim for \ncomplete treatment of endometriotic lesions to provide symp -\ntomatic control and reduce the number of laparoscopies (which \ncarries its own risks). Herein lies the issue with surgery as the \ndiagnostic test of choice – many patients exhibit endometriosis \nthat cannot be appropriately managed at a surgery that is si -\nmultaneously diagnostic. Laparoscopy for endometriosis should \nalways involve a comprehensive exploration of the abdominal \nand pelvic contents. To identify subtle lesions, the laparoscope \nmust be brought right up to the surfaces being inspected. In \naddition, the gastrointestinal and genitourinary systems need \nto be assessed as well, including the appendix. The diaphragm \nshould routinely be inspected, especially if the patient de -\nscribes right upper quadrant symptoms. If the patient under -\nwent a preoperative ultrasound/MRI where endometriosis was \nFigure 1: (modified of http://ftp.itec.aau.at/datasets/GLEN-\nDA/) Endometriosis healthy (left) and pathology (right) image. \n\nwww.jclinmedsurgery.com              3\nvisualized, these areas should be closely inspected surgically. In \nsome situations, endometriosis may not be obviously visible at \nlaparoscopy despite clear identification with imaging [16].  SE \nhas been described to have a black (“powder burn”) or dark blu-\nish appearance from the accumulation of blood pigments [17]. \nHowever, subtle forms can appear as white opacifications, red \nflamelike lesions, or yellow-brown patches in earlier, active stag-\nes of the disease [18]. Ovarian endometriomas have a distinct \nmorphology classically described as a “chocolate cyst” contain-\ning old menstrual blood giving it a dark brown appearance. Ad-\nhesions are often found in association with endometriomas and \nconsist of fibrous scar tissue because of chronic inflammation. \nIn many cases, there is endometriosis at the site of ovarian fixa-\ntion [19,20]. Like an imaging-based assessment following the \nIDEA protocol, the posterior and anterior compartments should \nbe assessed carefully for DE. Oftentimes, DE appears as mul -\ntifocal nodules and may infiltrate the surrounding viscera and \nperitoneal tissue [21]. As mentioned earlier, depending on the \nextent of POD obliteration, posterior compartment (USL, bow -\nel, PVF) DE may be difficult to assess and diagnose surgically, \nwith evidence supporting a better diagnostic test performance \nusing non-invasive imaging-based assessment for this specific \ntype of DE [22]. When combining diagnostic laparoscopy with \noperative laparoscopy, the surgeon must consider the impor -\ntance of a biopsy to ensure their visual diagnosis is correct. \nThere is ample evidence that surgeons overcall endometriosis \nat surgery [23-25]. When surgeons perform endometriosis exci-\nsion, all specimens should be sent to pathology for analysis. In \nsome cases, it is inappropriate to use biopsy as a diagnostic test. \nFor example, in a patient who undergoes diagnostic laparosco-\npy and the surgeon suspects bowel DE, this area should only \nbe biopsied/excised if the patient explicitly provided informed \nconsent following a discussion about the benefits and risks of \na “bowel surgery” component and the patient was adequately \nprepared with bowel preparation and antibiotic prophylaxis. \nSurgeons should also consider concurrent appendectomy dur -\ning excision of endometriosis since women with DE have a high \nrisk of appendiceal endometriosis [26]. Often, appendectomy \nis not within the skill set of gynecologists, which again creates \na unique challenge with surgery being used as a combined di -\nagnostic test and treatment modality. Deep convolutional net -\nworks such as GoogLeNet [27] have been successfully applied \nin countless domains. Such networks represent valuable back -\nbones in many deep architectures for image and video analy -\nsis. One such family of architectures that heavily use CNNs as a \nbackbone for Region-of-Interest (ROI) prediction and labeling is \ncalled region-based convolutional neural networks, or R-CNNs. \nThese R-CNNs after sufficient training are capable of detecting, \nclassifying, and even segmenting objects in images through in -\ntelligent arrangement and use of CNN elements. The increasing \nperformance improvements of deep learning in medicine entail \nan ever-expanding range of applications aimed at providing dig-\nital assistance to medical personnel in treating patients. Medi -\ncal imaging also varies greatly according to its purpose: mono -\nchrome images obtained from computed tomography (CT) or \nultrasound are very different compared to open surgery or \nendoscopic recordings. This generally makes scientific research \non medical image classification more difficult to compare than \ntraditional multimedia analysis. Surprisingly, endoscopic im -\nages have so far not been analyzed as digitally as many other \ntechnologies such as magnetic resonance imaging (MRI) [28]. \nHowever, they offer a wide variety of research topics for the \napplication of deep learning. For example, there are many stud-\nies on the classification or detection of content such as anat -\nomy and surgical tasks [29-31]. Ιn a recent research which is \nvery close to our approach, Visalaxi et al. 2021 have provided \na system for automatic diagnosis of endometriosis using deep \nlearning techniques [32]. The trained model was verified based \non the input images used and then model was used to classify \nthe category as pathological and non-pathological images. The \narchitecture of neural network model was designed where in -\nput consist of laparoscopic images are split as training, test and \nvalidation group independent of each other. The obtained im -\nage is in BGR format which once again converted into RGB for -\nmat i.e. images are annotated and then converted into Numpy \narray format [33]. The training and test image dataset in array \nformat are split as features and labels. Since it is binary class, \nonly two labels are mentioned in the model. The trained and \ntested accuracy were found to be 91% and 90% respectively. \nThe proposed model identifies the endometriosis by providing \nthe laparoscopic images alone as parameters for recognising \nthe presence. An effective and efficient approach of OpenCV \nfor pre-processing the data and ResNet50 based architecture \nfor training and testing the model of large datasets with raw \nlaparoscopic images were used. The prognostic model yields \nhigh accuracy (1) and throughputs as laparoscopic images were \ngiven as input.\nAccuracy is the quantity to measure the unambiguous value \n[34]. The accuracy and loss were calculated by fitting the model \nin the architecture. The trained and tested model yielded an \naccuracy of 92% and 90% respectively. The predicted model \nyielded an accuracy of 90%.\nMethodology: Our approach aimed to detect and segment \nendometriosis. We start by using the published GLENDA data -\nset. Next, we thoroughly describe all the data augmentation \ntechniques used. We detail the model training strategies and \nfinally list our evaluation results.\nPatient population and data collection: At the beginning \na retrospective study of patients’ health and pathology ones. \n2157 healthy and 2291 pathological (Figure1). Based on the final \nresults, we developed a novel assistant intelligent automated \nmethod to discriminate endometriosis with the improvement \nof laparoscopic images, as an additional tool to preoperative \nevaluation and improved planning of a minimally directed sur -\ngery. Glenda (Gynecologic Laparoscopy Endometriosis Dataset) \nwas used. Gynecologic laparoscopy as a type of Minimally Inva-\nsive Surgery (MIS) is performed via a live feed of a patient’s ab-\ndomen surveying the insertion and handling of various instru -\nments for conducting treatment. Adopting this kind of surgical \nintervention not only facilitates a great variety of treatments, as \nwell as it is also essential for numerous post-surgical activities, \nsuch as treatment planning, case documentation, and educa -\ntion. Nonetheless, the process of manually analyzing surgical \nimages, as it is carried out in current practice, usually proves \ntediously time-consuming. In order to improve upon this situ -\nation, more sophisticated computer vision as well as machine \nlearning approaches are actively developed. Since most such \napproaches heavily rely on sample data, which especially in \nthe medical field is only sparsely available, with this work we \npublish the Gynecologic Laparoscopy ENdometriosis DAtaset \n(GLENDA) – an image dataset containing region-based annota -\ntions of a common medical condition named endometriosis, i.e. \nthe dislocation of uterine-like tissue. The dataset is the first of \nits kind and it has been created in collaboration with leading \nmedical experts in the field (Figure 2) [35]. \n(1)\n\nwww.jclinmedsurgery.com              4\nFigure 2: (modified of http://ftp.itec.aau.at/datasets/GLEN-\nDA/) GLENDA dataset.\nPreoperative approach and final surgical procedure: Histori-\ncally the only potential cure for endometriosis is laparoscopic.\nsurgical staging method: In 2017, the World Endometriosis \nSociety consensus for the diagnosis of endometriosis recom -\nmended the use of the rASRM classification tool during surgery \nto classify endometriosis based on the size, extent, and location \nof lesions found (Figure 4) [36]. There are four stages ranging \nfrom minimal (Stage 1), mild (Stage 2), moderate (Stage 3), and \nsevere (Stage 4) [36,37]. However, a prospective analysis found \nconsiderable inter-variability among surgeons reducing its diag-\nnostic accuracy. In 2021, the AAGL Special Interest Group in En-\ndometriosis published the AAGL Classification Tool solely based \non intraoperative findings to better quantify the surgical com -\nplexity of endometriosis cases (Figure 5). Like the rASRM sys -\ntem, there are four AAGL endometriosis stages. However, the \nrecent validation study found higher reproducibility with the \nAAGL score (kappa=0.621) compared to rASRM (kappa=0.317) \nwhen discriminating surgical complexity [38]. The rASRM sys -\ntem fails to properly incorporate DE, which often equates to \nsurgical complexity, leading to this deficiency in the system. \nThe Enzian classification tool has been introduced in recent \nyears to better describe DE, and has recently introduced the \nupdated system, #Enzian, which also incorporates SE and tubal \npathology [36,39]. A recent study by Montanari and colleagues \ndemonstrates that the #Enzian system score can be accurately \npredicted with ultrasound, increasing the utility of this model \nsignificantly [40]. The Endometriosis Fertility Index (EFI), reli -\nant on the rASRM staging system, was also recommended after \nsurgical staging/treatment for women considering pregnancy \nin the future [36,40]. Although several staging tools exist, they \nmainly focus on the physical extent of the disease and do not \ncorrelate well with the pain symptoms and impact on quality of \nlife for patients [41]. Beyond accurately representing the expe-\nrience of the patient, there should be functionality to prognos-\nticate clinical outcomes, which currently only the EFI attempts \nto do. The utility of the newest system, the AAGL Classification \nTool, remains to be seen but it must be validated [42].\nResults\nKeras is an open-source library that provides a Python in-\nterface for artificial neural networks. Keras acts as an interface \nfor the TensorFlow library. Up until version 2.3 Keras supported \nmultiple backends, including TensorFlow, Microsoft Cognitive \nToolkit, Theano, and PlaidML [44-46]. As of version 2.4, only \nTensorFlow is supported. However, starting with version 3.0 \n(including its preview version, Keras Core), Keras will become \nmulti-backend again, supporting TensorFlow, JAX, and PyTorch \n[47]. Designed to enable fast experimentation with deep neu-\nral networks, it focuses on being user-friendly, modular, and \nextensible. It was developed as part of the research effort of \nproject ONEIROS (Open-Ended Neuro-Electronic Intelligent Ro-\nbot Operating System) and its primary author and maintainer \nis François Chollet, a Google engineer. Chollet is also the author \nof the Xception deep neural network model [48,49]. Keras con-\ntains numerous implementations of commonly used neural net-\nwork building blocks such as layers, objectives, activation func-\ntions, optimizers, and a host of tools for working with image \nand text data to simplify programming in deep neural network \nareas. The code is hosted on GitHub, and community support \nforums include the GitHub issues page and a Slack channel.\nIn addition to standard neural networks, Keras has support \nfor convolutional and recurrent neural networks. It supports \nother common utility layers like dropout, batch normalization, \nand pooling [50]. Keras allows users to produce deep models \non smartphones (iOS and Android), on the web, or on the Java \nVirtual Machine [45]. It also allows the use of distributed train-\ning of deep-learning models on clusters of Graphics Processing \nUnits (GPU) and Tensor Processing Units (TPU) [51]. Biblio -\ngraphic research indicated that ResNet-50 is the best option as \na base model for medical image data. Using ResNet-50 for creat-\ning a medical image model is a popular choice due to its deep \narchitecture and effectiveness in handling complex features in \nimages. ResNet-50 is a variant of the ResNet (Residual Network) \nmodel, which introduced the concept of residual learning [52-\n54]. This approach allows the model to learn residual functions, \nmaking it easier to train very deep neural networks without \nencountering the vanishing gradient problem. In the context \nof medical image analysis, where images can be highly detailed \nand intricate, the depth of the network and its ability to capture \nsubtle patterns and features become crucial.\nHere are a few reasons why ResNet-50 might be chosen for \nmedical image analysis:\nHandling deep networks: ResNet-50’s architecture with re-\nsidual blocks enables the training of very deep networks (50 \nlayers in this case) without vanishing gradient issues. Deeper \nnetworks can learn more complex features, which is valuable \nin medical image analysis where identifying intricate patterns \nis essential [54].\nFeature extraction: ResNet-50 excels at feature extraction. \nMedical images often contain hierarchical and multi-scale fea -\ntures. ResNet-50’s design allows it to automatically learn and \nextract features at various levels of abstraction, making it suit -\nable for diverse medical imaging tasks [52-54].\nPretrained models and transfer learning: ResNet-50 models \npre-trained on large datasets (like ImageNet) are readily avail -\nable. Transfer learning, where a pre-trained model is fine-tuned \non a specific dataset, can be incredibly effective in medical im -\nage analysis where labeled datasets are limited. By using pre-\ntrained weights, the model has already learned generic features \nfrom a massive dataset, which can boost its performance on \nsmaller, specialized datasets [52-54].\nRegularisation and generalization: The skip connections \n(residual connections) in ResNet-50 act as implicit regularizers. \nThey help prevent overfitting, which is crucial when dealing \nwith medical image datasets that are often small and can be \nprone to overfitting [52-54]. \nResearch and benchmarking: ResNet-50 has been exten -\nsively studied and used in various research papers and compe -\ntitions. Its performance and capabilities are well-documented \n\nwww.jclinmedsurgery.com              5\nin the literature, making it a reliable choice for medical image \nanalysis tasks [52-54]. By leveraging ResNet-50, researchers and \npractitioners in the field of medical image analysis can benefit \nfrom the model’s depth, feature extraction capabilities, and the \nadvantages of transfer learning, ultimately leading to more ac -\ncurate and robust medical image analysis systems.\nPathological class processing: Visualizing the specific fea -\ntures that the network has learned to recognize as indicative of \nthe pathological class can be challenging due to the complexity \nof deep neural networks. Techniques like activation maximiza -\ntion or gradient-based visualization methods can be used to \ngain some insights, but interpreting deep learning models in \ndetail remains an ongoing area of research. In order to access \nthe layer that can produce meaningful images from the under -\nstanding of the classes and the features used for classification \nwe need to identify the latest 4-dimensional layer (Figure 3).\nData preparation \nOverview:\n      ●  All data are separated into two folders, healthy and \npathology ones.\n      ●  2157 healthy\n      ●  2291 pathology\n      ●  80% for training, 20% for validation \nSeveral preprocessing steps are applied to our dataset con -\ntaining images of two classes: ‘healthy’ and ‘pathology’.\nHere’s a breakdown of the preprocessing steps:\nLoading images: Images from the directories specified in the \n`base_path` variable are loaded using the `load_img` function. \nThis function loads an image file into a PIL (Python Imaging Li -\nbrary) object [55-57].\nConverting images to arrays:  The loaded images are con -\nverted into numerical arrays using the `img_to_array` func -\ntion from Keras. This function converts a PIL array instance to \na Numpy array.\nResizing images: The images are resized to fit the input size \nexpected by the ResNet-50 model, which is 224x224 pixels. \nOpenCV’s `cv2.resize` function is used for this purpose.\nBuilding x (feature) and y (label) arrays:  The resized image \narrays are appended to the list `X`, and the corresponding class \nlabels (‘healthy’ or ‘pathology’) are appended to the list `y`. \nVectorization also takes place in this step. Vectorization refers \nto the process of converting non-numeric data into a numerical \nformat that can be processed by machine learning algorithms.\nConverting y labels to numerical format: The class labels in \nthe list `y` are mapped to numerical values using a dictionary `y_\ndict`. ‘healthy’ is mapped to 0, and ‘pathology’ is mapped to 1.\nShuffling the data:  The data (both X and y) is shuffled us -\ning `np.random.permutation`. Shuffling the data is essential to \nInput Photo Heatmap Superimposed visualization \n \n(a) \n \n(b) \n \n(c) \n \n \n \n \n \nFigure 3: Presentation of input photo (a). Heatmap (b). super-\nimposed visualization (c). Before classification.\nensure that the model does not learn any order-based patterns \nduring training.\nChoosing a basic model: Initially we decided to build a basic \nmodel and evaluate its efficiency for our dataset. \nTherefore we chose a basic sequential model with two ad -\nditional layers:\nInput Photo Heatmap Superimposed visualization \n \n(a) \n \n(b) \n \n(c) \n \n \n \n \n \nConsequently the results are extracted with:\nInput Photo Heatmap Superimposed visualization \n \n(a) \n \n(b) \n \n(c) \n \n \n \n \n \n Based on the results, even after hyper-parameter tuning ex-\nploration, the accuracy could be described as equal to a ran -\ndomly assigned result. \nModel training with Resnet50: We chose as final model \nresnet50 with the same additional layers as in the base model. \nWe used the same hyper-parameters as well.\n \n\n\nwww.jclinmedsurgery.com              6\nReferences\n1.   Endometriosis: Overview». 2017. www.nichd.nih.gov. \n2.  Endometriosis: Condition Information. 2017. www.nichd.nih.\ngov.\n3.  Endometriosis». 2017. womenshealth.gov. \n4.  Diagnosis of Endometriosis at Laparoscopy: A Validation Study \nComparing Surgeon Visualization with Histologic Findings Sara-\nMichelle Gratton 1, Abdul Jamil Choudhry 2, George A Vilos 3, \nAngelos Vilos 4, Kristina Baier 5, Simonne Holubeshen 6, Maria \nCassandra Medor 7, Stéphanie Mercier 8, Vincent Nguyen 9, In-\nnie Chen 10 PMID: 34562632 DOI: 10.1016/j.jogc.2021.08.013 \nhttps://pubmed.ncbi.nlm.nih.gov/34562632/.\n5.  Bulletti, Carlo; Coccia, Maria Elisabetta; Battistoni, Silvia; Borini, \nAndrea. «Endometriosis and infertility». Journal of Assisted Re -\nproduction and Genetics. 2010; 27(8): 441-447. doi:10.1007/\ns10815-010-9436-1. ISSN 1573-7330. PMID 20574791.\n6.  Vercellini, Paolo; Eskenazi, Brenda; Consonni, Dario; Somigliana, \nEdgardo; Parazzini, Fabio; Abbiati, Annalisa; Fedele, Luigi. «Oral \ncontraceptives and risk of endometriosis: a systematic review \nand meta-analysis». Human Reproduction Update. 2011; 17(2): \n159-170. doi:10.1093/humupd/dmq042. ISSN 1460-2369. PMID \n20833638.\n7.  GBD Disease and Injury Incidence and Prevalence Collabora -\ntors. «Global, regional, and national incidence, prevalence, and \nyears lived with disability for 310 diseases and injuries. 2015; \n1990-2015: a systematic analysis for the Global Burden of Dis -\nease Study 2015». Lancet (London, England). 2016; 388 (10053): \n1545-1602. doi:10.1016/S0140-6736(16)31678-6. ISSN 0140-\n6736. PMID 27733282. PMC 5055577 (10 September 2017).\n8.  McGrath, Patrick J. Stevens, Bonnie J.· Walker, Suellen M.· Zemp-\nsky, William T. Oxford Textbook of Paediatric Pain. (OUP Oxford. \n2013; 300. ISBN 9780199642656. (10 September 2017)).\n9.  GBD 2013 Mortality and Causes of Death Collaborators. «Glob -\nal, regional, and national age-sex specific all-cause and cause-\nspecific mortality for 240 causes of death, 1990-2013: a sys -\ntematic analysis for the Global Burden of Disease Study 2013.». \n2014; 385: 117-71. doi:10.1016/S0140-6736(14)61682-2. PMID \n25530442.\n10.  Brosens I. Endometriosis: Science and Practice. John Wiley & \nSons. 2012;3. ISBN 9781444398496.\n11.  Leibetseder A, Petscharnig S, Primus MJ, Kletz S, Münzer B, \nSchoefmann K, Keckstein J Lapgyn4: a dataset for 4 automatic \ncontent analysis problems in the domain of laparoscopic gyne -\ncology. In: César P , Zink M, Murray N (eds) Proceedings of the \n9th ACM multimedia systems conference, MMSys.  2018, June \n12-15, 2018. ACM, Amsterdam, The Netherlands. 2018; 357-\n362. https:// doi.org/10.1145/3204949.3208127.\n12.  Canis M, Donnez J, Guzick D, Halme J, Rock J, Schenken R, Ver -\nnon M (1997) Revised American society for Reproductive Medi-\ncine classification of endometriosis:  Fertility and Sterility. 1996; \n67(5): 817-821. https://doi.org/10.1016/S0015-0282(97)81391-\nX.\n13.  Keckstein J, Hudelist G (2020) Classification of die including bow-\nel endometriosis: from r-asrm to #enzian-classification. Best \nPract Res Clin Obstet Gynaecol, Keckstein J, Ulrich U, Possover \nM, Schweppe K et al Enzian-klassifikation der tief infiltrierenden \nendometriose. Zentralblatt für Gynäkologie. 2003; 125: 291.\n14.  Leibetseder A, Kletz S, Schoeffmann K, Keckstein S, Keckstein \nJ. GLENDA: gynecologic laparoscopy endometriosis dataset. \nIn: Ro YM, Cheng W, Kim J, Chu W, Cui P , Choi J, Hu M, Neve \nWD (eds) MultiMedia Modeling - 26th International Conference, \nChecking the accuracy and the loss curves for both models \nwe can see the results (Figure 4):\n \nFigure 4: Experimental results based on formula (1), presenting \naccuracy (a) and loss (b).\nTable 1: Accuracy metrics of basic and final models compared \nwith recent reference of recent work (Visalaxi et al. 2021).\nFinal model Recent Publication*\nPrecision 0.99 0.83\nRecall 0.99 0.82\nF1 Score 0.99 0.82\nAccuracy 0.99 0.90\nDiscussion\nIn clinical practice the minimally invasive laparoscopy can \nbe demonstrated beneficial as it could support health profes -\nsionals in making critical and evidence-based medical decisions. \nCloser to our approach Visalaxi et al. 2021 have provided a sys-\ntem for automatic diagnosis of endometriosis using deep learn-\ning techniques by using ResNet50 algorithm and yielded an ac -\ncuracy of 91%. However, they reported that with a larger data \nset, they might have better accuracy rates. We developed our \nresearch using a much larger data set. The final developed com-\nputer system in our research, based also on the ResNet50 algo-\nrithm, predicted the best outcome for all participants who had \nlaparoscopic surgical therapy. The Keras tool was used and the \ngenerated code was implemented in Python language provid -\ning a mean accuracy of 99%. The presented approach revealed \nbetter performance than the commonly used imaging criteria in \npredicting endometriosis as it improves the time and the total \naccuracy of evidence-based diagnosis and consequently the fol-\nlowing treatment. Additionally, using video during endoscopy \nthe system could compare the input images with the internal \nreasoning model, even on-line accurate results.\n\nwww.jclinmedsurgery.com              7\nMMM 2020, Daejeon, South Korea, January 5-8, 2020, Proceed-\nings, Part II, Springer, Lecture Notes in Computer Science. 2020; \n11962: 439-450. https://doi.org/10.1007/978-3-030-37734-\n2_36.\n15. Group TmotEGC, Becker CM, Bokor A, Heikinheimo O, Horne A, \nJansen F, et al. ESHRE guideline: endometriosis†. Human Repro-\nduction Open. 2022; 2022.\n16.  Goncalves MO, Siufi Neto J, Andres MP , et al. Systematic evalua-\ntion of endometriosis by transvaginal ultrasound can accurately \nreplace diagnostic laparoscopy, mainly for deep and ovarian en-\ndometriosis. Human Reproduction. 2021; 36(6): 1492-500.\n17.  Mettler L, Schollmeyer T, Lehmann-Willenbrock E, et al. Accura-\ncy of laparoscopic diagnosis of endometriosis. 2003; 7(1): 15-8.\n18.  Jansen RP , Russell P . Nonpigmented endometriosis: clinical, lap-\naroscopic, and pathologic definition. Am J Obstet Gynecol. 1986; \n155(6): 1154-9.\n19.  Rao T, Condous G, Reid S. Ovarian Immobility at Transvaginal \nUltrasound: An Important Sonographic Marker for Prediction \nof Need for Pelvic Sidewall Surgery in Women With Suspected \nEndometriosis. J Ultrasound Med. 2021.\n20.  Reid S, Leonardi M, Lu C, et al. The association between ultra -\nsound-based ‘soft markers’ and endometriosis type/location: A \nprospective observational study. Eur J Obstet Gynecol Reprod \nBiol. 2019; 234: 171-8.\n21.  Koninckx PR, Ussia A, Adamyan L, et al. Deep endometriosis: \ndefinition, diagnosis, and treatment. Fertil Steril. 2012; 98(3): \n564-71.\n22.  Leonardi M, Condous G. A pictorial guide to the ultrasound \nidentification and assessment of uterosacral ligaments in wom-\nen with potential endometriosis. Australasian Journal of Ultra -\nsound in Medicine. 2019; 22(3): 157-64.\n23.  Gratton SM, Choudhry AJ, Vilos GA, et al. Diagnosis of Endome-\ntriosis at Laparoscopy: A Validation Study Comparing Surgeon \nVisualization with Histologic Findings. J Obstet Gynaecol Can. \n2021.\n24.  Fernando S, Soh PQ, Cooper M, et al. Reliability of visual diag -\nnosis of endometriosis. J Minim Invasive Gynecol. 2013; 20(6): \n783-9.\n25.  Wykes CB, Clark TJ, Khan KS. Accuracy of laparoscopy in the diag-\nnosis of endometriosis: a systematic quantitative review. BJOG. \n2004; 111(11): 1204-12.\n26.  Moulder JK, Siedhoff MT, Melvin KL, et al. Risk of appendiceal \nendometriosis among women with deep-infiltrating endome -\ntriosis. Int J Gynaecol Obstet. 2017; 139(2): 149-54.\n27.  Szegedy C, Liu W, Jia Y , Sermanet P , Reed S, Anguelov D, Erhan \nD, Vanhoucke V, Rabinovich A (2015) Going deeper with con -\nvolutions. In: Proceedings of the IEEE conference on computer \nvision and pattern recognition, pp 1-9]. or ResNet [ He K, Zhang \nX, Ren S, Sun J Deep residual learning for image recognition. In: \n2016 IEEE conference on computer vision and pattern recog -\nnition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, IEEE \nComputer Society. 2016; 770-778. https://doi.org/10.1109/\nCVPR.2016.90\n28.  Rai HM, Chatterjee K, Gupta A, Dubey A novel deep cnn \nmodel for classification of brain tumor from mr images. In: \n2020 IEEE 1st international conference for convergence in \nengineering (ICCE). 2020;134-138. https://doi.org/10.1109/\nICCE50343.2020.9290740, Rai HM, Chatterjee K, Dashkevich S \nAutomatic and accurate abnormality detection from brain mr \nimages using a novel hybrid unetresnext-50 deep cnn model. \nBiomedical Signal Processing and Control. 2021; 66: 102477.\n29.  Leibetseder A, Petscharnig S, Primus MJ, Kletz S, Münzer B, \nSchoeffmann K, Keckstein J. Lapgyn4: a dataset for 4 automatic \ncontent analysis problems in the domain of laparoscopic gyne -\ncology. In: César P , Zink M, Murray N (eds) Proceedings of the \n9th ACM multimedia systems conference, MMSys 2018, June \n12-15, 2018. ACM, Amsterdam, The Netherlands. 2018; 357-\n362. https://doi.org/10.1145/3204949.3208127.\n30.  Zadeh SM, Francois T, Calvet L, Chauvet P , Canis M, Bartoli A, \nBourdel N  Surgai: deep learning for computerized laparoscopic \nimage understanding in gynecology. Surgical Endoscopy. 2020; \n34(12): 5377-5383.\n31.  Petscharnig S, Schöffmann K. Learning laparoscopic video shot \nclassification for gynecological surgery. Multimedia Tools and \nApplications. 2018; 77(7): 8061-8079.\n32.  Automated prediction of endometriosis using deep learn -\ning S. Visalaxia, T. Sudalai Muthua Int. J. Nonlinear Anal. Appl. \n2021; 2: 2403-2416. ISSN: 2008-6822 (electronic) http://dx.doi.\norg/10.22075/ijnaa.2021.5383.\n33.  G. Bradski and A. Kaehler, Learning OpenCV: Computer Vision \nwith the OpenCV Library, O’Reilly Media, Inc. 2008.\n34.  Y . D. Wang, M. Shabaninejad, R.T. Armstrong and P . Mostaghimi, \nDeep neural networks for improving physical accuracy of 2D and \n3D multi-mineral segmentation of rock micro-CT images, Appl. \nSoft Comput. 2021; 104:107185.\n35.  GLENDA dataset https://dl.acm.org/doi/abs/10.1007/978-3-\n030-37734-2_36.\n36.  Johnson NP , Hummelshoj L, Adamson GD, et al. World Endome-\ntriosis Society consensus on the classification of endometriosis. \nHuman Reproduction. 2017; 32(2): 315-24.\n37.  American Society for Reproductive M. Revised American Soci -\nety for Reproductive Medicine classification of endometriosis: \n1996. Fertility and Sterility .1997; 67(5): 817-21.\n38.  Abrao MS, Andres MP , Miller CE, et al. AAGL 2021 Endometrio-\nsis Classification: An Anatomy-based Surgical Complexity Score. \nJ Minim Invasive Gynecol. 2021; 28(11): 1941-50.\n39.  Keckstein J, Saridogan E, Ulrich UA, et al. The #Enzian classifi -\ncation: A comprehensive non-invasive and surgical description \nsystem for endometriosis. Acta Obstet Gynecol Scand. 2021; \n100(7): 1165-75.\n40.  Adamson GD, Pasta DJ. Endometriosis fertility index: the new, \nvalidated endometriosis staging system. Fertil Steril. 2010; \n94(5): 1609-15.\n41.  International working group of AAGL E, ESHRE, WES, et al. Endo-\nmetriosis classification, staging and reporting systems: a review \non the road to a universally accepted endometriosis classifica -\ntion†,‡. Human Reproduction Open. 2021; 2021(4).\n42.  Espada M, Leonardi M, Reid S, et al. Regarding “AAGL 2021 En -\ndometriosis Classification: An Anatomy-based Surgical Complex-\nity Score”. J Minim Invasive Gynecol. 2021.\n43.  Montanari E, Bokor A, Szabó G, et al. Accuracy of sonography \nfor non-invasive detection of ovarian and deep endometriosis \nusing #Enzian classification: prospective multicenter diagnostic \naccuracy study. Ultrasound Obstet Gynecol. 2021.\n44.  “Keras backends”. keras.io. Retrieved. 2018.\n45.  “Why use Keras?”. keras.io. Retrieved. 2020.\n46.  “R interface to Keras”. keras.rstudio.com. Retrieved. 2020.\n47.  “Introducing Keras Core: Keras for TensorFlow, JAX, and Py -\nTorch”. Keras.io. 2023.\n\nwww.jclinmedsurgery.com              8\n48.  “Keras Documentation”. keras.io. Retrieved. 2016.\n49.  Chollet, François. “Xception: Deep Learning with Depthwise \nSeparable Convolutions”. 2016. arXiv:1610.02357.\n50.  “Core - Keras Documentation”. keras.io. Retrieved. 2018.\n51.  “Using TPUs | TensorFlow”. TensorFlow. Archived from the origi-\nnal on 2019-06-04. 2018.\n52.  Deep Learning in Image Classification using Residual Network \n(ResNet) Variants for Detection of Colorectal Cancer - ScienceDi-\nrect.\n53.  ResNet and its application to medical image processing: Re -\nsearch progress and challenges – ScienceDirect. \n54.  Transfer learning with fine-tuned deep CNN ResNet50 model for \nclassifying COVID-19 from chest X-ray images – PMC. \n55.  [1512.03385]. Deep Residual Learning for Image Recognition. \n56.  Convolutional Neural Networks for Medical Image Analysis: Fine \nTuning or Full Training?.\n57.  A survey on deep learning in medical image analysis – Science -\nDirect.","source_license":"CC0","license_restricted":false}