COUNTEN, an AI-Driven Tool for Rapid and Objective Structural Analyses of the Enteric Nervous System

Abstract The enteric nervous system (ENS) consists of an interconnected meshwork of neurons and glia residing within the wall of the gastrointestinal (GI) tract. While healthy GI function is associated with healthy ENS structure, defined by the normal distribution of neurons within ganglia of the ENS, a comprehensive understanding of normal neuronal distribution and ganglionic organization in the ENS is lacking. Current methodologies for manual enumeration of neurons parse only limited tissue regions and are prone to error, subjective bias, and peer-to-peer discordance. There is accordingly a need for robust, and objective tools that can capture and quantify enteric neurons within multiple ganglia over large areas of tissue. Here, we report on the development of an AI-driven tool, COUNTEN (COUNTing Enteric Neurons), which is capable of accurately identifying and enumerating immunolabeled enteric neurons, and objectively clustering them into ganglia. We tested and found that COUNTEN matches trained humans in its accuracy while taking a fraction of the time to complete the analyses. Finally, we use COUNTEN’s accuracy and speed to identify and cluster thousands of ileal myenteric neurons into hundreds of ganglia to compute metrics that help define the normal structure of the ileal myenteric plexus. To facilitate reproducible, robust, and objective measures of ENS structure across mouse models, experiments, and institutions, COUNTEN is freely and openly available to all researchers.


Introduction
Gastrointestinal (GI) motility is regulated by the enteric nervous system (ENS; Spencer and Hu, 2020). The majority of the neurons and glia of the ENS are contained within the myenteric plexus, where they are clustered in interconnected ganglia of various sizes (Sternini, 1988). Alterations in ENS structure, gauged by parameters such as neuron density or number of neurons per ganglia, are associated with GI dysmotility (Rao and Gershon, 2018). While ENS structure is thus relevant to health and disease, methods by which it can be comprehensively assessed are limited. Currently there are no objective methods to capture and quantify enteric neurons over large tissue areas or within multiple ganglia. The challenge of objectively quantifying ENS structure at both the neuronal and ganglionic level is particularly acute. While some studies have calculated aggregate myenteric neuronal densities (Gabella, 1987;Santer and Baker, 1988;Kunze and Furness, 1999), they have addressed the ganglionic organization of these neurons (defined here as the number of neurons per individual ganglia, or number of ganglia per area of tissue) in other limited ways.). Recent studies have computed average ganglia size (Gianino et al., 2003;Becker et al., 2018); however, because of the laborious process of manually counting and clustering neurons, these studies have analyzed only isolated tissue areas, thus precluding more comprehensive understanding of the structure of the adult myenteric plexus. In addition, since myenteric ganglia show a diversity of shapes and sizes, and exhibit varying degrees of proximity from each other, manual enumeration and clustering of neurons into ganglia is prone to error, subjective bias, and peer-to-peer discordance. Hence, there is a critical need for objective and rapid tools and methods for standardized enumeration and classification of myenteric neurons into ganglia over large tissue areas to build a comprehensive understanding of ENS structure.
In this report, we present COUNTEN (COUNTing Enteric Neurons), the first automated, open-source software that uses computer-vision and image-processing methods for high-throughput analysis of widefield microscopy images to reliably identify, enumerate, and cluster myenteric plexus neurons in a rapid and objective manner.

Animals
All animal experiments were conducted in accordance with the protocols that were approved by the Animal Care and Use Committee of Johns Hopkins University in accordance with the guidelines provided by the National Institutes of Health. Nine-week-old littermate male mice from the C57BL/6 (Charles River) background, which were housed in the same cage, were used for the experiment.

Tissue isolation
Mice were anesthetized with isoflurane and killed by cervical dislocation. An abdominal incision was made to perform a laparotomy and isolate intestines that were gently pulled out and placed in a clean Petri dish containing sterile ice-cold Opti-MEM solution. The intestinal contents were flushed using ice-cold sterile PBS after which the terminal ileum, defined as the last 5 cm of small intestinal tissue before the cecum, was dissected out. The longitudinal muscle containing myenteric plexus (LM-MP) tissue from the terminal ileum was peeled out with a sterile clean cotton swab, cleaned in sterile ice-cold OptiMEM, flattened on a dish and fixed with freshly prepared ice-cold 4% paraformaldehyde solution for 30 min. The tissue was washed in sterile ice-cold PBS and used for immunostaining.

Immunostaining
Fixed LM-MP tissues were incubated at room temperature (RT) while shaking in blocking permeabilization buffer (BPB; 5% normal goat serum, 0.1% Triton X-100 in sterile PBS), after which tissues were washed in sterile PBS and incubated overnight with rabbit anti-HuC/D primary antibody (1:750; Abcam) at 16°C with constant shaking. The tissues were removed from the primary antibodies, washed three times (10 min each) with PBS and incubated in Goat anti-Rabbit Alexa Fluor 488 secondary antibody (Invitrogen) at RT for 1 h in the dark. Subsequently the tissues were washed three times (10 min each) with PBS and mounted with Prolong Anti-Fade mounting medium containing nuclear stain DAPI (Invitrogen). Care was taken not to let the tissue fold on itself during the mounting process.

Imaging
Using an EVOS M7000 motorized-stage fluorescent microscope (Thermo Fisher), tissues were imaged with a 20Â objective (EVOS AMEP4924; Fluorite LWD, 0.45 NA/ 6.23WD). Imaging was performed such that the entire width of the tissue was imaged over variable length. Care was taken not to image folded tissues. Initial concordance measurements of COUNTEN versus manual counting were done using images of individual fields. Subsequently, individual images were stitched together to generate a composite image that was used for COUNTEN analysis for generating the ENS map.

Manual counting
Manual counting of HuC/D-immunostained neurons was performed by a trained technician using the plugin Cell Counter on ImageJ. Special attention was given to counting individual HuC/D labeled cells, without counting the same cell twice. Classification of neurons into ganglia was done by following the rule of defining a cluster of more than or equal to three neurons as a ganglion. Ganglionic boundaries were established as published in earlier studies (Kulkarni et al., 2017). The total number of ganglia per image and number of neurons per ganglia were thus enumerated and tabulated.

Software
The COUNTEN workflow consists of four sequential steps ( Fig. 1): (1) image pre-processing; (2) neuron identification; (3) neuronal clustering into ganglia; and (4) image post-processing for segmentation. This algorithm was implemented in Python using the scikit-image, NumPy, and scikit-learn libraries. The same workflow was used for all the processing described in this report.

Code accessibility
The COUNTEN software is freely available without restrictions on GitHub (https://github.com/KLab-JHU/COUNTEN) and is uploaded as a zip file with this submission (Extended Data 1).
COUNTEN requires two user-specified parameters as input: the pixel density r (pixels/mm) as dictated by the imaging protocol, and the full width at half maximum s (pixels) of a Gaussian smoothing kernel used during preprocessing. The four steps of the workflow are detailed below: Image pre-processing This step eliminates noise and staining variations, which might otherwise confound the results. We opted for a simple procedure, which can easily be replicated across different equipment configurations. The RGB image was first converted to a single grayscale channel and processed using an isotropic Gaussian filter. Larger blurs will reduce the contribution of extraganglionic neurons but also make the algorithm more susceptible to false negatives. Smaller blurs may result in insufficient de-noising of the image. We empirically determined that setting the Gaussian full width at half maximum to s ¼ 7 pixels yields neuronal counts highly concordant with those of human raters (see Fig. 2). Hence, we fixed s ¼ 7 for all analyses in this work. Next, we divided the image into nine equal partitions and used the center region to set a threshold between foreground (neurons) and background (GI tract). We use the center region to avoid biasing the threshold based on abnormalities at the tissue edges. The threshold is selected adaptively using Otsu's method (Otsu, 1979), which minimizes the intraclass variance.

Neuron identification
This procedure searches for and returns all local maxima within the image, separated by a distance of at least d m (pixels). In other words, the peaks are local maxima of a circular neighborhood in the image with a prespecified radius of d m . When there are multiple peaks within the same neighborhood, then the average of these coordinates is returned. We fixed the default value of d m according to the pixel density r as follows: d m in pixels ð Þ¼ 2:5mm x r : We note that the parameter d m is accessible to users within the Python source code and can be modified from this default value as needed for other imaging protocols.

Clustering into ganglia
We used the density-based spatial clustering of applications with noise (DBSCAN) algorithm (Ester et al., 1996) to cluster the peak locations from step 2 into ganglia. DBSCAN is effective in our application since it does not assume a predefined number of clusters, and allows for unlabeled points (i.e., extraganglionic neurons). The DBSCAN algorithm takes as input two parameters, the minimum number of neurons in a ganglion N g , and the minimum separation between ganglia « m . Here, we fixed N g ¼ 3 (ganglia contain at least three neurons), and this convention was kept constant between COUNTEN-driven neuronal and ganglionic counts and manual counts by technician. We fixed the default value of « m according to the pixel density r as follows: « m in pixels ð Þ¼ 20:6mm x r : Once again, the parameter « m is accessible to users within the Python source code and can be modified from this default setting as needed.

Output segmentation
We binarized the image and used the watershed segmentation algorithm (Barnes et al., 2014) to flood the background pixels. This procedure leaves just the identified ganglia as the final output. The algorithm also colors the ganglia for ease of visualization.

Results
We designed the COUNTEN algorithm to follow a sequence of four steps (Fig. 1): (1) image pre-processing using Otsu's adaptive thresholding method (Otsu, 1979) to separate foreground neurons from background tissue; (2) neuron identification based on peak intensities within a local neighborhood; (3) neuronal clustering into ganglia using the DBSCAN algorithm (Ester et al., 1996); and (4) image post-processing via watershed segmentation (Barnes et al., 2014). We found that these four steps provide high-concordance data on the enumeration of neurons present in tissue and within defined ganglia (Fig. 1).
To test the concordance of COUNTEN over a larger number of images, we analyzed adult murine ileal LM-MP (iLM-MP) tissue. We first evaluated whether COUNTEN correctly identified and enumerated neurons with the same precision as human experts. We analyzed 100 images (n = 100), each representing a random 20Â field of view of iLM-MP tissue immunostained with antibodies against pan-neuronal marker HuC/D. Each image depicted different numbers of neurons and we found that COUNTEN achieved high concordance with manual enumeration of neurons performed by human experts (Fig.  2A). In effect, every neuron identified by COUNTEN was also identified by manual counting.
Second, we evaluated the accuracy of the ganglionic clusters identified by COUNTEN. We defined a ganglion as a cluster of more than or equal to three neurons and defined ganglionic edges and boundaries by labeling the contours of the HuC/D-expressing cell clusters as previously published (Kulkarni et al., 2017). While manual counting identified 413 ganglia in total, COUNTEN achieved similar performance and identified 411 ganglia across the 100 images, underscoring COUNTEN's reliability. Further, analysis of ganglia size exhibited a similar high degree of concordance between manual and COUNTEN methodologies (r 2 = 0.9257; Y ¼ 0: 9998pX 1 1:058; Fig. 2B). Beyond its reliability, COUNTEN offers a tremendous reduction in the time spent on the analysis. For reference, a technician took 2 d to analyze 100 images, while COUNTEN processed the same number of images in ,10 min, providing us with a platform that performs rapid, precise, and objective neuronal and ganglionic counts in HuC/D-immunostained iLM-MP tissue.
Third, we used COUNTEN to quantify metrics that are often used for ganglionic organization within the iLM-MP. In contrast to our earlier tests of COUNTEN on single fields of views, here we deployed COUNTEN on widefield images generated from multiple stitched contiguous 20Â images of HuC/D-immunostained iLM-MP tissue from three adult male littermate mice. We imaged areas of 46.15, 48.83, and 36.34 mm 2 , which we found to contain 15741, 13268, and 9247 neurons within 778, 742, and 475 ganglia, respectively. Using COUNTEN-generated data, we calculated the neuronal density in the three tissues to be 344.33, 288.21, and 269.03 neurons/mm 2 and the ganglionic density was calculated to be 16.86, 15.19, 13.07 ganglia/mm 2 .
Finally, we used COUNTEN-generated data to study mean ganglia size and ganglia diversity. Ganglia size in none of the three tissues followed normal distribution (Anderson Darling test, p , 0.0001), and the mean ganglia size between the three tissues, computed to be 20.23, 17.88 and 19.47 neurons/ganglia, were not statistically different (Kruskal-Wallis test; Fig. 2C). The frequency distribution of ganglia size across the three tissues showed inverse correlation of ganglia size and their relative abundance (Fig. 2D), which can be summarized by a negative binomial equation: Y ; NBð X À 3 ð Þ; 0:58; 0:035Þ:

Discussion
The ENS has been previously described at an anatomic, physiological, and transcriptomic level (Costa et al., 2000;Spencer and Hu, 2020;Morarach et al., 2021), yet a detailed, overarching structural analysis of ENS plexuses within defined intestinal tissue areas has not been performed. This can be attributed to the lack, until now, of reliable tools and methods for enumerating large numbers of enteric neurons from distinct tissue segments and clustering them into ganglia.
In this report, we describe the generation and methodology for use of COUNTEN, the first open-source tool for rapid, automated and objective enumeration and clustering of ENS neurons. Prior tools such as ImageJ, while providing modules and macros that allow for correct enumeration of neurons, require human intervention to identify and cluster neurons into ganglia, making the procedure slow and subjective (Keating et al., 2013). COUNTEN, on the other hand, relies solely on computer-vision algorithms to parse a large number of images in a short duration of time, and applies a single definition for neuronal clustering equally to all the images to produce rapid and objective neuronal and ganglionic enumeration.
To showcase the ability of COUNTEN, we compared human manual counting using an already available tool, ImageJ, with COUNTEN to analyze 100 images of immunostained-iLM-MP tissue. While COUNTEN took a fraction of the time that a trained technician took to parse through the images, we found there to be a high degree of conformity between manual counting and COUNTENgenerated data (Fig. 2B), suggesting that the gains in speed with COUNTEN were not associated with a loss in accuracy with regards to the identification and enumeration of neurons and their classification into ganglia.
The rapidity with which COUNTEN analyzes immunostained images of iLM-MP tissue allowed us to generate high-fidelity data on neuronal numbers and ganglia size from a large region of tissue. We analyzed these data to show how COUNTEN can help the scientific community construct large scale statistical maps of the ENS. We used COUNTEN-generated data to establish that ganglia size is conserved across ileal tissues from sex-matched littermate mice. We further used these data to establish the parameters of a negative binomial equation that defines the frequency distribution of ileal ganglia size. Along with neuronal and ganglionic density, this equation provides the metrics of ganglionic organization in the iLM-MP and can be used as a reference for future studies. These analyses show how rapid and objective neuronal enumeration by COUNTEN can help the scientific community define ENS structure in animal models of health and disease.
While COUNTEN is a significant advance in our ability to interrogate ENS structure, it is a first-generation tool and has a few limitations. The performance of COUNTEN depends on the robustness and homogeneity of immunostaining and imaging, which we have standardized (see Materials and Methods). Further, while ganglia are threedimensional (3D) structures, the current algorithm does not operate on 3D image-data. However, the high concordance between COUNTEN and human-generated data, suggests that the data generated by COUNTEN are as accurate as those generated by a human observer. Finally, COUNTEN is currently limited to interrogating HuC/D-immunolabeled neurons and does not have the ability to query two different immunolabels. However, to facilitate rapid and reproducible measurement of ENS structure within the broader ENS community and to propel the development of this tool in an open-source manner, COUNTEN is freely and openly available to researchers. As an open-source, freely-available tool under active development, the authors and the scientific community alike can add modules to the existing program that may increase the future functionality of COUNTEN.