Abstract
Hirschsprung disease (HD) is a congenital disorder characterized by the absence of ganglion cells in the colonic nervous plexuses, resulting in bowel obstruction and various complications. The diagnosis of HD demands expertise, experience, and ancillary tests. Our objective was to design an artificial intelligence (AI) tool to facilitate the diagnostic process of HD and evaluate its performance in terms of sensitivity, specificity, and average area under the curve (AUC). Using a camera-equipped microscope, we digitized 222 high-power fields of view obtained from H&E-stained slides. Nuclei were segmented using a deep learning algorithm and manually annotated by an expert pathologist. From these, 2076 nuclei were selected, including 346 ganglion cells and 1730 non-ganglion cells. A set of 100 features related to shape, color, and texture was extracted from the nuclei. To evaluate their utility in distinguishing the two categories, a cross-validation scheme was employed. The nuclei were randomly divided into training (70%) and validation sets (30%). The Wilcoxon signed-rank test was employed to identify the top features in the training set, which were then used to train an AI classifier to distinguish between the two categories: Ganglion cell and non-ganglion cell. The classifier's performance was assessed using the validation set, yielding an average AUC = 0.98. The classifier's performance was assessed using the validation set, yielding an average AUC = 0.98. Taken together, our findings indicate that this AI-driven framework may serve as a valuable support tool for pathologists, facilitating the diagnosis of HD in routine clinical practice.
Keywords
Introduction
Hirschsprung disease (HD) is a congenital disorder of migration, differentiation, and proliferation of neural crest-derived ganglion cells that normally reside in the Meissner and Auerbach plexuses of the colonic wall.1–6 There is also hypertrophy of nerve fiber bundles, muscularis propria hypertrophy, myenteric plexus fibrosis, amplified histochemical staining for acetylcholinesterase (AChE), and absence of reactivity for calretinin1–5,7–9 (Figure 1). As a result of aganglionosis, there is a functional obstruction of the bowel, giving rise to various complications, including necrotizing enterocolitis, intestinal perforations, and failure to thrive.1–5 Worldwide, the incidence is 1:5000 live births.1,2

Colorectal tissue. (A) (*) Nerve bundles have a normal size. The blue arrow shows a group of ganglion cells. H&E, 100×. (B) A group of ganglion cells. H&E, 400×. (C) Hypertrophic nerve bundles (*). H&E, 100×. (D) Endothelial cells, commonly mistaken for ganglion cells (blue arrows). H&E 400×.
Though anorectal manometry and barium enema are important diagnostic tools, the histopathologic diagnosis on rectal biopsies is the diagnostic gold standard, with a sensitivity and specificity of 93% to 97% and 99%, respectively.1–4,7,8
Histological study of the obtained biopsies requires expertise, careful evaluation of all the levels from each of the biopsies (50-100 according to local protocols), and ancillary tests.3–5 It is a time-consuming and complex process, and mistakes can end up in unnecessary interventions or the appearance of disease's associated complications.3,5,7 Common mistakes include mistaking plasma cells, endothelial cells, or glial cells for ganglion cells, not being able to identify immature ganglion cells, or misinterpreting the results of histochemistry or immunohistochemistry stains3–5 (Figure 1).
HD's diagnosis in low and middle-income countries is usually belated due to the inexperience of surgeons and pathologists and the absence of standardized protocols and adequate resources. 3 As a result, in Colombia, less than one third of patients with Hirschsprung are diagnosed in the neonatal period, and up to 44% of the patients are diagnosed after they reach a year of age. 3
Recognizing the pressing need for more efficient and accessible diagnostic methods, we turn to the realm of digital pathology. Digital pathology offers a promising avenue for revolutionizing diagnostic practices by providing a platform for the digitization, analysis, and interpretation of pathological images. 10 Artificial intelligence (AI)-driven tools have demonstrated remarkable proficiency in various medical applications, including diagnostic, prognostic, and predictive tasks, especially in cancer.6,10 HD diagnosis could be reduced to a dichotomous dilemma: the presence or absence of ganglion cells, making it amenable to automation through AI.2,6,11,12 The primary objective of this research endeavor was to construct an AI-powered tool specifically tailored for the identification of ganglion cells in normal colorectal tissue.
Methods
Dataset
After obtaining approval from the Institutional Review Board and ethics committee of the institution that owns the data, colorectal H&E pathology slides taken for innervation studies were selected from the pathology archives. Forty-four slides from 25 patients containing normally innervated colorectal tissue were used.
A total of 222 high-power fields in 40× magnification were captured from these slides using a Nikon (Tokyo, Japan), Microscope Eclipse E200, equipped with a Panasonic (Kadoma, Japan) 14MP USB camera. The high-resolution images obtained measured 4320 × 3240 pixels.
Nuclear Segmentation and Manual Annotation
Every individual cell nucleus in each high-power field was automatically segmented using QuPath 13 in combination with the state-of-the-art deep learning model StarDist, 14 a pre-trained model (dsb2018_heavy_augment) with all parameters left at their defaults. Segmentation was run at native image resolution (pixel size = 0), using percentile normalization (2-98%), probability threshold = 0.5, overlap (NMS) threshold = 0.5, and tile size = 4320 × 3240 pixels. No preprocessing steps were applied beyond QuPath's built-in normalization. This process generated 39,918 segmented nuclei. Afterwards, based on morphological nuclear, and cytoplasmic attributes, the segmented nuclei were annotated using QuPath as either “ganglionar” or “non-ganglionar” by a pathology resident (AS) and validated by an experienced pediatric pathologist (NO) (more than 15 years). After this process, 346 nuclei were classified as “ganglionar” and the remaining 39,572 as “non-ganglionar.”
Feature Extraction
Image color normalization using Macenko's algorithm 15 was applied to each high-power field to compensate for potential staining variations of slides. Based on a previous publication, 16 one hundred features related to shape, color, and texture were then extracted from each nucleus (Supplementary Table 1). A visual representation of this feature extraction process is illustrated in Figure 2.

General scheme of the study. (A) Colorectal Tissue. (B) Submucosal plexus with numerous ganglion cells. (C) Nuclei are segmented from the rest of the image. A set of characteristics are extracted from all the nuclei. The best performing for distinguishing between categories were selected for training of an AI classifier. (D) The AI classifier successfully distinguished between ganglion and non-ganglion cells.
AI Model Training
Given the class imbalance, we performed random undersampling of the majority class by uniformly discarding non-ganglion nuclei until a ganglion to non-ganglion ratio of 1:5 was obtained. In this way, the final number of nuclei was 2076, comprising 346 ganglion cells and 1730 non-ganglion cells. Assignments were performed using a random, unbiased sampling strategy across the entire dataset, which preserves the overall class distribution and minimizes selection bias.
A cross-validation methodology was employed to assess the utility of the 100 nuclear-extracted features in differentiating between ganglion and non-ganglion nuclei. The 2076 nuclei were randomly divided into training and validation subsets, with the training set containing 70% (1453) of the nuclei, and the validation set comprising the remaining 30% (623).
In each iteration of the cross-validation, the top discriminative features were selected from the training set using a Wilcoxon signed-rank test-based feature selection method.17,18 Next, we tested multiple classifiers including support vector machine, random forest, QDA, and linear discriminant analysis (LDA); evaluating accuracy, area under the curve (AUC), F-measure, precision, recall and specificity. Table S1 shows the results of these experiments. Since LDA achieved the highest AUC and F-measure, it was selected for training with the top discriminative features, with the goal of distinguishing between ganglion and non-ganglion cell nuclei. Once the model was trained, it was applied to the validation set, and its performance was assessed by computing the area under the receiver operating characteristic curve (AUC) compared with the ground truth defined as the pathologist's annotations. This cross-validation process was repeated 500 times to ensure robust and statistically sound evaluations of the classifier's performance. Figure 3 provides a graphical summary of this process Table 1.
Flux diagram of the study. Performance of the Classifier. LDA, linear discriminant analysis; QDA, quadratic discriminant analysis; SVM, support vector machine; AUC, area under the curve.
Results
Of the selected specimens, 15 were obtained from men, 8 were from women, and in two specimens there was no information concerning sex. The youngest of the selected patients was 23 days of age, and the oldest 9 years of age; the mean age was 15 months.
The top 5 discriminative features were: area, eccentricity, the ratio between axes, and equivalent diameter, all of which are related to nuclei shape. Figure 4 displays the respective box plots for these features, comparing ganglion and non-ganglion cells and Figure 5 displays the histogram of feature selection frequency across 500 iterations.

Box plots for the top predictive features. Category 0 (black) represents non-ganglion cells whereas Category 1 (yellow) represents ganglion cells. The greater heterogeneity observed among non-ganglion cells reflects the broad range of cell types included in this group. Although the boxplot may visually suggest that some cells have an area of zero, which would be biologically implausible, this is an artifact of the y axis scale, where each tick represents 2500 pixels. The smallest measured cell area was 20 pixels. Importantly, no pixel-based quality thresholds or exclusion criteria were applied; all detected cells were included in the analysis.

Histogram of feature selection frequency across 500 iterations. Features 1, 2, 8, and 37 were selected in all iterations, while feature 3 was selected in nearly all specimens, indicating high consistency of the feature selection process. Feature 14 was selected in a single iteration and is not visible due to its negligible frequency. Although the selected features are highly stable, minor variation in their relative importance ranking was observed across iterations.
Morphological nuclear features such as area, equivalent diameter, eccentricity, and axis ratio are effective for discriminating ganglion cells because they directly reflect the well-described histologic characteristics of these cells. Enteric ganglion cells possess large, round to oval, vesicular nuclei with prominent nucleoli, reflecting their high transcriptional activity and abundant cytoplasmic machinery. These traits translate into greater nuclear area and larger equivalent diameter compared to non-ganglion cells such as fibroblasts, lymphocytes, or smooth muscle cells, which typically have smaller, darker, and more compact nuclei. Additionally, ganglion cell nuclei are relatively round, leading to lower eccentricity and an axis ratio closer to one, whereas many non-ganglion cells—especially fibroblasts, smooth muscle cells, and glia—display elongated or spindle-shaped nuclei, resulting in higher eccentricity and higher major/minor axis ratios. Because these quantitative features capture the classic morphologic distinctions that pathologists routinely use under the microscope, they provide a robust basis for distinguishing ganglion from non-ganglion nuclei in computational image analysis.
After evaluating our computational tool, we observed an average AUC value of 0.98 ± 0.01 using the LDA classifier. This demonstrates the capability of our approach to distinguish between ganglion and non-ganglion nuclei within the examined dataset. Figure 6 is a graphical representation of our tool's performance. In terms of sensitivity and specificity, our tool achieved an average performance of 0.84 ± 0.04 and 0.97 ± 0.01, respectively.

Receiver operating curve and area under the curve (AUC).
Discussion
HD is a congenital disorder characterized by the absence of ganglion cells in the nervous plexuses of the colonic wall, resulting in functional bowel obstruction and giving rise to various complications such as necrotizing enterocolitis, intestinal perforations and failure to thrive.1–5 Histopathologic evaluation of rectal biopsies is the diagnostic gold standard, with sensitivity and specificity of 93% to 97% and 99%, respectively.1–4,7,8 Since mistakes can lead to unnecessary interventions or disease-associated complications, establishing an accurate diagnosis is of utmost importance.3,5,7 However, this process is challenging, time-consuming, requires expertise and experience, and often demands the use of ancillary tests.3–5 All of this makes it difficult to establish a proper diagnosis in low and middle-income countries, due to the inexperience of surgeons and pathologists, and the absence of standardized protocols. 3
Utilizing a set of 222 high-power field images from colorectal H&E slides with preserved intestinal innervation, we performed nuclei segmentation, constructed binary masks, and classified these nuclei as either ganglion or non-ganglion cells. Subsequently, we extracted 100 characteristics related to shape, color and texture from the nuclei set. In a randomly selected subset of 2076 nuclei, a Wilcoxon signed-rank test was employed to identify the most effective features for distinguishing between the two categories. Using these features, an AI classifier was trained, and its performance was evaluated using a cross-validation scheme. Area, eccentricity, Ratio Axes and EquivDiameter were the more frequently selected features, all of which are related to nuclei shape. As figure 4 shows, nuclei from ganglion cells were larger and rounder compared to those from non-ganglion cells, and this enabled the AI classifier to distinguish between them. The performance of the AI classifier was remarkable, as average sensitivity, specificity, and AUC were 0.84, 0.97, and 0.98, respectively.
Previous studies have explored applying AI and machine learning to HD diagnosis. 6 Some were performed using only digitized formalin-fixed paraffin-embedded (FFPE) H&E slides (as in our study), while others used both digitized FFPE and frozen sections (FS). Greenberg et al developed a tool with the same sensitivity (96%) and higher specificity (99%), using only FFPE tissue. 11 Their approach was similar, using annotations of ganglion cells and suspected ganglion cells to train their classifier; however, they had an additional step, as they fine- tuned the algorithm by having pathologists review and correct false positives and false negatives. 11 The validation method was also more complex, as it involved an additional set of images and a score to determine the need for evaluation by an expert pathologist. 11 This approach involved more time in its development, due to the use of an intermediate step for fine tuning of the algorithm, however, global performance was similar.
Demir et al 19 developed a tool to assist with intraoperative assessment of FS, using both FFPE and FS WSI to train their model. Three highly experienced pathologists independently annotated the dataset, defining two classes, class 1 (patches with ganglion cells), and class 0 (patches without ganglion cells). The learning model employed a ResNet-50, pretrained on ImageNet for feature extraction, with a Grad–CAM layer added to generate heatmaps. The resulting tool processes high-resolution FS WSI, analyzes them in an average of 2 minutes, and directs the pathologist's attention to a heatmap indicating probability of observing ganglion cells. Performance was evaluated solely on FS WSI, with external validation on two independent datasets from different hospitals, including both FFPE and FS WSI. The model achieved accuracy of 91.3%, 92.8%, and 90.1% across the three centers’ datasets. The authors also conducted a reader study to assess practical utility. Two phases, separated by a mean of 3-week interval, used the same 50 WSI (half with ganglion cells, half without). In phase 1, pathologists followed their routine process, classifying specimens as positive (ganglion cells present), negative, or uncertain. In phase 2, they reviewed the same whole slide images (WSIs) alongside two patches per slide, and corresponding heatmaps. Use of the model increased average accuracy from 77% (phase 1), to 85.8% (phase 2), and reduced the average diagnosis time from 139.7 to 70.5 seconds. Compared with this study, our tool shows a similar performance in identifying ganglion cells; however, it was evaluated using FFPE patches rather than FS, complicating direct comparison. Their tool had multi-institutional validation and reader study, both absent in our work, and both enhanced their potential for clinical use. We have opportunities to improve in external validation and practical utility evaluation.
Duci et al 20 collected resection specimens from Hirschsprung's disease patients over a 10-year period. FFPE H&E-stained slides from ganglionic, transition and aganglionic zones were manually segmented into 40 patches (256 × 256 pixels each). Annotation proceeded by encircling ganglion cells, normal and hypertrophic nerves, from which they created a corresponding mask. 1945 images were used, 80% for model development/ training, 20% for validation. To develop two network models, they created subsets: dataset 1 (930 images of ganglion cells and normal nerves), and dataset 2 (1015 images of hypertrophic nerves), both enriched with background-only images. Evaluation compared manually segmented masks with the algorithm's predictions. Model 1 (trained on dataset 1), segmented ganglion cells and normal nerves, tended to overdetect ganglion cells and achieved 92.3% accuracy (19). Model 2 (trained on dataset 2) segmented hypertrophic nerves and background, misclassified 7.5% of ganglionic zone patches, accurately segmented aganglionic regions, and achieved an accuracy of 91.50%. As a result of this design, transition zone images were segmented by both models. Overall, the algorithm achieved 92.3% accuracy for ganglion cells and 91.5% for hypertrophic nerves. Compared with our tool, their algorithm showed lower ganglion cell detection accuracy, but uniquely, it also identified hypertrophic nerves, potentially aiding transition zone identification, a practical diagnostic advantage we lack. Both tools require external validation to confirm clinical utility.
Histochemistry can also be used as starting point, as shown by Braun et al. 21 They collected rectal and colon biopsies stained with AChE and counterstained with hematoxylin. Slides were digitized, software detected stained areas, and regions of interest (ROIs) containing only the mucosal layer and muscularis mucosae were selected. The areas stained with AChE, hematoxylin, or both were measured as a percentage of the selected ROI. The median AChE-positive area was greater in samples with confirmed aganglionosis (AUC 0.816 for HD prediction); colocalized tissue area was also greater in HD specimens (AUC 0.86) (20). Rectal biopsies alone yielded AUCs of 0.883 (AChE-positive) and 0.867 (colocalized). Because AChE-stained area alone generated many false positives, the authors used machine learning to assess parasympathetic hyperinnervation. A pixel classifier was trained on 512 × 512 pixels images from the mucosal region of both HD disease and normal patients’ slides, using 10-fold cross-validation, with adjusted training sets. The test cohort comprised manually selected mucosal ROIs from unused slides. Parasympathetic hyperinnervation scores were significantly higher in HD patients than controls (mean AUC 0.959), improving to 0.993 after exclusion of colon biopsies. This study demonstrated that digital pathology and machine learning analysis of AChE staining differences can aid HD diagnosis, particularly for mucosa-only biopsies. However, like our model, it lacks external validation. In our context, AChE staining is not routinely performed in local laboratories, making it less practical than our algorithm.
Other studies have used scanned immunohistochemistry-stained colorectal slides from FFPE tissue.2,22 Law et al, for example, used calretinin-stained slides, evaluated area and axis ratio to distinguish ganglion cells, and corrected false positive and false negative results of the classifier. 2 Their validation process was carried out in only one specimen, obtaining a precision of 85.7% and 72% recall. Schilling et al 22 measured the intensity of staining for calretinin, MAP2, S100B and GLUT1 to distinguish between HD and non-HD specimens using a 10-fold cross-validation scheme. The distinction between HD and non-HD was more effective with calretinin and MAP 2. They achieved a positive predictive value of 83%, sensitivity of 87.5%, specificity of 80%, and F1 score of 88.9% in the test set. When compared to our study, ours has the advantage of using H&E staining as an entry point, thereby reducing the costs and turnaround times.
Showing that the developed tools also have educational potential, Greenberg et al 12 trained five pathologists without prior experience in the diagnosis of HD using the diagnostic algorithm previously described. 11 The algorithm selected a set of images, and the pathologists assigned a score between 1 and 5 to each image based on the certainty of the presence of ganglion cells. Two iterations were conducted for all the images without any form of training between them. Before the third iteration, training in the identification of ganglion cells was provided, and their performance was evaluated, revealing a significant increase in the proportion of correct diagnosis, confidence, and a reduction in referrals. There were also more false positives related to the identification of non-specific elements as ganglion cells; however, the false negatives remained unaffected.
Our study has limitations. The first of them is a limited representation of immature ganglion cells. Also, our developed classifier was not trained to specifically detect mature or immature cells. However, one can argue that, in our context, in which innervation studies are usually carried out after the neonatal period, this is not an important limitation for the use of our classifier. Our validation process also had a limited representation of immature ganglion cells. We made the decision to use a hand-crafted approach because of its easier interpretation and reproducibility; however, future research endeavors could use a deep learning approach and compare its results with the ones obtained with our initial approach. To ascertain the possibility of using our tool as a diagnostic tool in the future, it is necessary to carry out a validation process using more slides obtained from different institutions and with a larger representation of immature ganglion cells which. If the result of this process is favorable, our next task would be to develop a software tool with an amenable graphic interphase to make this tool user-friendly and available in resource-constrained environments. This tool is meant to support—not replace—pathologists. Because it may generate false negatives (eg, immature ganglion cells) or false positives (eg, lymphocytes), pathologists must still oversee and verify its output. Much like with immunohistochemical stains, the final interpretation remains the pathologist's responsibility.
In summary, we developed a computer-based approach to assist in the diagnosis of HD based on manual selection of features via a Wilcoxon signed-rank test and its performance was evaluated using a cross-validation scheme. Our method demonstrated good diagnostic performance, making it a strong candidate for inclusion in our diagnostic arsenal of HD, particularly in low-income settings. Additionally, this study highlights the potential utility of computer-based tools in aiding the diagnosis of diseases requiring specific cell identification. Further, due to its simplicity and practicality, it could be applied in the future for the development of nuclear classification algorithms in other contexts. Ideally, WSIs would be used, and this tool would automatically flag potential ganglion cells. The ultimate goal would be to begin the review with the algorithm-identified ROIs, rather than manually searching through the entire tissue fragment or slide to locate these cells, making ganglion cell search more efficient, which could be used intraoperatively or on regular.
Supplemental Material
sj-docx-1-ijs-10.1177_10668969261437754 - Supplemental material for Automatic Detection of Ganglion Cells as a Supporting Tool for Hirschsprung Disease Diagnosis
Supplemental material, sj-docx-1-ijs-10.1177_10668969261437754 for Automatic Detection of Ganglion Cells as a Supporting Tool for Hirschsprung Disease Diagnosis by Andrés Siabatto-Cleves, MD, Paula Toro, MD, Natalia Olaya, MD, PhD, Kevin Maldonado-Cañón, MD, MS, Edna Quintero, MD, Fernando Fierro, MD, and Germán Corredor, PhD, MS in International Journal of Surgical Pathology
Footnotes
Acknowledgments
Research reported in this publication was supported by the Peer Reviewed Cancer Research Program (W81XWH-21-1-0160) and the Mayo Clinic Breast Cancer SPORE grant P50 CA116201 from the NIH. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health, the Department of Defense, or the United States Government.
Ethical Approval
Ethical approval for this study was obtained from an ethics committee or institutional review board.
Author Contributions
P.T., G.C., N.O, A.S-C. did study concept, design, development of methodology, writing and review of the article; K.M-C., G.C and P.T. did analysis and interpretation of data and statistical analysis. E.Q and F.F. account for writing and review of the article. All authors read and approved the final paper.
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the NIH, Peer Reviewed Cancer Research Program, Mayo Clinic Breast Cancer SPORE (grant numbers W81XWH-21-1-0160, P50 CA116201).
Declaration of Conflicting Interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Supplemental Material
Supplemental material for this article is available online.
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
