{'fraction_non_alphanumeric': 0.02465295510469381, 'fraction_numerical': 0.011049723756906077, 'mean_word_length': 5.18077474892396, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Automating Detection of Papilledema in Pediatric Fundus Images with Explainable Machine Learning

Papilledema is an ophthalmic neurologic disorder in which increased intracranial pressure leads to swelling of the optic nerves. Undiagnosed papilledema in children may lead to blindness and may be a sign of life-threatening conditions, such as brain tumors. Robust and accurate clinical diagnosis of this syndrome can be facilitated by automated analysis of fundus images using deep learning, especially in the presence of challenges posed by pseudopapilledema that has similar fundus appearance but distinct clinical implications. We present a deep learning-based algorithm for the automatic detection of pediatric papilledema. Our approach is based on optic disc localization and detection of explainable papilledema indicators through data augmentation. Experiments on real-world clinical data demonstrate that our proposed method is effective with a diagnostic accuracy comparable to expert ophthalmologists.


INTRODUCTION
The human visual system develops over several years during early childhood and fully matures around age seven years. During this critical period of development, there are potential clinically-relevant issues that may emerge or manifest. One such issue, papilledema, occurs when increased intracranial pressure leads to swelling, or edema, of the optic nerves. It is crucial to diagnose pediatric papilledema early, because it could indicate a serious underlying neurologic disorder, such as a brain tumor. Untreated papilledema may also lead to vision loss or blindness. Early diagnosis of papilledema using fundus imaging enables clinicians to perform prognosis and timely therapeutic intervention. Fundus imaging uses a specialized low-power microscope camera to photograph the interior surface of the eye, including the retina and the optic disc (Fig. 1). A major challenge that is faced in the robust and accurate detection of pediatric papilledema is the presence of pseudopapilledema [1], an abnormality that occurs when the optic disc is elevated without swelling of the optic nerve. As a result, no threatening disorders are associated with pseudopapilledema. However, due to similar clinical presentations, yet significantly different treatment protocols, distinguishing between pseudopapilledema and papilledema is critical for efficient care. This task is especially challenging using conventional diagnostic tools like fundus images, even for trained ophthalmologists [2].
The availability of large clinical datasets along with highperformance processors and advances in machine learning systems enable us to design image processing algorithms that can automate the clinical diagnosis procedures [3,4,5]. However, a major drawbackof deep learning is that the feature extraction process from 1 Code available at https://github.com/klean2050/papilledema input images can be automated using an end-to-end blind supervised training procedure. As a result, interpreting the decision process by such a deep neural network (DNN) is challenging. Moreover, empirical explorations have demonstrated that, despite high-accuracy performances, DNNs do not necessarily use a human-centered and interpretable decision process. In clinical decision making, which is a high stakes setting, it is thus often difficult for experts to rely on "black-box" DNN-based methods. To address this shortcoming, in this paper we develop a multi-branch deep neural network to classify an input fundus image as a papilledema or a pseudopapilledema case. Our proposed model extracts interpretable features from the input through data augmentation and multi-view training, thus leading to a decision process similar to that of expert ophthalmologists.

BACKGROUND
The optic nerve in the human visual system contains axons that pass signal information from eyes to the brain. High intracranial pressure can cause these axons to swell, leading to papilledema. The diagnosis of papilledema in children at early stages is crucial because pediatric papilledema can be a sign of life-threatening conditions such as brain tumors and meningitis [6]. Several automated algorithms have been proposed recently to detect papilledema using fundus images. Milea et al. [3] demonstrated that deep learning can differentiate healthy optic discs from papilledema cases using fundus images with a clinically acceptable accuracy. Saba et al. [7] explored the effect of different deep neural network architectures on the eventual classification accuracy. Vasseneix et al [8] demonstrated that the diagnosis accuracy of AI-based methods is comparable to that of professional ophthalmologists [8]. However, these studies do not account for the critical confound arising due to the presence of pseduopapilledema in the input. Moreover, in the cases that do [2], they primarily focus on adult subjects, where the differentiation between papilledema and pseudopapilledema is typically easier than in children. Indeed, anatomic differences in younger patients render pseudopapilledema more similar in appearance to papilledema [9].
Since pseudopapilledema is not a sign of a serious neurologic disorder [10], distinguishing pseudopapilledema from papilledema at an early stage can help to circumvent the expensive and sometimes invasive clinical testing required for patients with papilledema. Although the ability to distinguish between the two is an invaluable need, works on this direction in human-centered AI-based medicine are limited. Despite demonstrating plausibility of using AI for this task, a few recent AI-based works use the standard black-box training regime of deep learning [2,3,11] which makes their clinical applicability limited. Consequently, there is an unmet need to design explainable algorithms for this problem to screen patients who may not be examined immediately by ophthalmologists and also to assist clinicians in challenging diagnostic cases.

METHODOLOGY
Our goal is to incorporate human-interpretable physiological indicators into the deep learning framework by using appropriate image transformations. In Section 3.1 we introduce the selected indicators based on the clinical practice of distinguishing between papilledema and pseudopapilledema. In Sections 3.2 and 3.3 we describe our algorithm to extract regions of clinical interest and the image transformations we use to emphasize the presence of the considered biomarkers in fundus images. Last, in Section 3.4 we describe the proposed deep learning architecture for papilledema detection.

Papilledema Indicators
To overcome the challenge of clinical differentiation of papilledema from pseudopapilledema, Carta et al. [12] conducted a machine learning study in adults and children with various causes of pseudopapilledema and optic disc edema (including papilledema) in which they came up with four robust signs on fundus examination that are specific to presence of papilledema: • Swelling (Fig. 1a): blurring of vessels at optic disc contour.
• Elevation (Fig. 1c): anterior extension of the optic nerve head on retinal surface. • Congestion (Fig. 1d): enlargement and tortuosity of the arcuate and peripapillary venous vessels.
These clinical indicators can be located on, or at the perimeter of the optic disc, hence the first step of our algorithm is to detect and extract the optic disc as the region of interest.

Optic disc Detection
Optic disc detection, localization and segmentation have been extensively investigated [13,14,15]. Most works fine-tune deep learning models on binary masks of optic discs using a manually-annotated dataset [3]. Given that we have access only to a small number of fundus images without such fine-grained annotations in our dataset, we develop an unsupervised optic disc detection algorithm based on intensity thresholding and morphological operations.
Optic disc is typically one of the brightest regions in fundus images. This stems from concentration of blood vessels in that region, which mainly enhances intensity in the red and green channels of the RGB image. However, while intensity thresholding is a wellfollowed heuristic for optic disc detection [16], there could be other bright spots in the image, e.g., due to some disease or imperfect image capturing conditions, that can distort the detection outcome [15]. Also, the green channel is most sensitive to outer vascular structures. Hence we isolate the red channel of each image and apply thresholding at 20% of the mean intensity value so as to extract the greater region of the retina. We then apply sequential morphological opening and closing operations to shape the retina binary mask (Fig. 2b). Afterwards, we fit a circle around that region and crop the encircled disc at a 20% smaller radius. By doing so, we eliminate marginal noisy illumination. For the majority of cases, this is already a consistent isolation of the optic disc's greater region, as depicted in Fig. 2c.
In order to improve detection, we further apply mean filtering to alleviate the effect of vascular structure and then threshold to mask the optic disc. The threshold was estimated empirically at 99% of the maximum intensity value, so as to isolate only the brightest components. Again, we apply morphological filtering to form a cohesive disc region (Fig. 2d) and fit an enlarged bounding box (Fig. 2e) to account for possible misalignment. In addition to producing good detection results, our unsupervised approach also provides a way to scale up the task of optic disc detection. Specifically, we verify the area and eccentricity of the proposed disc mask (Fig. 2d) in order to avoid false artefact detection. We thereby discard all components with no eccentricity and select the one with the highest area out of the remaining. If the condition is not met, the cropped image from the first step (Fig. 2c) is returned as a better estimate.

Augmentation Procedure
After isolating the region of interest (Fig. 1), we use suitable image transformations to unveil papilledema indicators. We subsequently use these transformations in our model to contrast different input views of an image. The proposed scheme focuses on properties of separate color channels in fundus imaging. While the red channel could usually isolate the optic disc quite well, as described in Section 3.2, it can also depict hemorrhages or hyperemia in the greater optic disc region. These are also small-scale retinal blood structures that become brighter in the red channel. On the other hand, the green channel is mostly associated with perceived contrast and identification of vessels [17]. Hence, it would be informative in detecting congestion and swelling. Finally, schematically identifiable features like elevation or hemorraghes can be located in any of the transforms or the original image under additive contrast.
Based on the these characteristics, we create three input views from each fundus image, to be trained together through a tri-branch model: the cropped image of the optic disc and the cropped images with adjusted contrast on the red and green channels. The proposed model is depicted in Fig. 3. Each image is fed into a different pretrained branch to detect the respective features. We apply the transformations every time the sample is called during training. Each time, the contrast factor is a uniformly sampled value between 1.5 and 1.8. We specified the range of the contrast factor through cross-validation, aiming to produce substantially diverging but not distorted visual outcomes. During test time, images are augmented using the minimum factor value of 1.5.

Architecture and Training
We use a Densenet121 [18] for feature extraction in each branch of the proposed model (Fig. 3) as it has been proven efficient in identifying papilledema in one of the most comprehensive AI studies [3] and is a prominent choice for medical tasks [19,20]. Each branch has been pretrained on ImageNet and is fine-tuned on our small-scale fundus image dataset. The output feature vectors of each branch are projected to 128D embeddings, which are then concatenated to create an eventual feature vector for classification.
A combination of supervised and unsupervised loss functions is used to efficiently train the model for leveraging the augmented views of the input. Cross-entropy loss J1(y, y * ) is used for label supervision, where y ∈ {0, 1} denotes the presence of pseudopapilledema or papilledema, and y * is the model output prediction. Two triplet losses J2(v, vred), J3(v, vgreen) contrast the 128D embeddings vred, vgreen of the augmented views to that of the original image v. Positive pairs are created between the embedding of an original image and those of its two computed augmentations. Negative pairs are created by random assignments of augmented views to original images within a batch. Triplet losses then attempt to minimize the anchor's cosine distance to the positive example, while maximizing its distance to the negative one. We train first for 10 epochs using J ≤10 and then, until a total of 50, using J>10, where: In (1) we used a balanced combination of triplet losses, λ2 = λ3, whereas in (2) we emphasize supervised training with λ1 λ2, λ3. Each model instance is trained using Early-Stopping with a patience of 5 epochs of non-decreasing validation loss. AdamW [21] optimizer with a static learning rate of 1e-4 is used. To avoid overfitting, the DenseNet backbones are kept frozen and we solely fine-tune their output embedding layers until convergence.

EXPERIMENTAL SETUP
For the purposes of this study we collected a dataset of 331 pediatric fundus images that we obtain clinically from 105 subjects at Children's Hospital Los Angeles and University of California, Los Angeles between 2011 and 2021. All subjects were under 18 years of age at the time of diagnosis, specifically between 1 and 17 years old, with a median of eleven. 67 were females and the rest of them (36.2%) males. All charts were reviewed to confirm that the children whose fundus photos were used met strict diagnostic criteria for papilledema or pseudopapilledema. Children diagnosed with papilledema were required to have neuroimaging evidence of an intracranial lesion (such as brain tumor) causing increased intracranial pressure, or a lumbar puncture with opening pressure greater than 28cm H2O. Children with pseudopapilledema were required to either have 1) normal neuroimaging and lumbar puncture with opening pressure less than 28cm H2O or 2) six months of follow-up showing no change in optic nerve appearance. The images were uploaded with de-identified clinical data to the HIPAA-compliant Research Electronic Data Capture (REDCap) database at USC. 149 out of 331 images were annotated as having papilledema, accounting for 44 subjects in total, and the rest (58%) as having pseudopapilledema.
We use the whole dataset of 331 fundus images to train and validate our proposed model in multiple sessions. We first distinguish between the samples of different subjects to avoid information leakage from within-subject correlations. The resulting stratified splits contain approximately 75% train and 25% test sample images, chosen uniformly at random. We perform a 10-fold repeated cross-validation over 5 sessions in order to derive an average performance metric for our model. The accuracy of classifying papilledema against pseudopapilledema was evaluated by calculating accuracy scores and area under the receiver-operating-characteristic curve (AUC), in consistency with most studies in the field [3,8,11].

RESULTS
The performance results of the proposed methods are shown in Table 5. We report mean score and standard deviation among 5 repeats of 10-fold cross validation. The baseline approach includes a single pretrained DenseNet model, trained on the original dataset using a standard cross-entropy loss. We observe that even this simplistic approach can distingusih papilledema against pseudopapilledema at above 72% on average, more than 3% higher than the reported accuracy of human experts on our data and 6% higher than human accuracy on external data [9]. After performing optic disc detection and constrain the system in the region that the prominent papilledema 0.787 ± 0.009 0.785 ± 0.007 DenseNet121 (2X : RG) 0.789 ± 0.008 0.788 ± 0.008 Table 2. Ablative experiments on branches of the proposed architecture and on the selected objective at 10-fold cross-validation. Each cross-validation experiment was repeated 5 times. Mean values and standard deviation of evaluation metrics are reported.
indicators concentrate, the accuracy increases by 6% to reach 78.3% AUC and 78.1% on accuracy. Furthermore, models' predictions are now less variable and show a reduced deviation from the mean score. By further applying our augmentation strategy during training, we reach 80% in accuracy, 8% above our baseline. It is noteworthy that the augmentation method applied to the original image set provides a rather slight improvement of 1%.
We report ablation experiments in Table 2 to further articulate the effectiveness of the proposed architecture and the training procedure, i.e., necessity of all model branches and all optimization terms for optimal performance. We first trained the architecture by omitting the use of contrastive losses on the augmented views. The averaged outcome does not point to a significant difference compared to the proposed approach. However, we observe that the training strategy we followed alleviates severe representational differences between the augmented views, hence it prevents sessions of severely deviating performance that we otherwise encounter. This is reported through the reduced deviation from the average scores. We also trained the proposed architecture (Fig. 3) by fusing only 2 out of the 3 channels. We observe marginal non-significant improvements compared to the single-branch model, thus indicating the importance of incorporating all branches for effective predictions. This observation also implies that training with the single red or green augmented channel would not provide any further significant insights.

DISCUSSION
By comparing our results for automatic detection of papilledema versus pseudopapilledema against clinical predictions that were overseen by the authors, we observe that image processing systems based on deep learning are capable of at least matching human experts' capacity in clinical diagnosis. Our proposed methodology aims at providing clinicians with an explainable and trustworthy screening assistant. To this end, our focus on papilledema signs on the optic disc region as well as the utilized image transforms indeed show significant improvement from the baselines, both regarding the average performance, the convergence consistency, as well as the training and inference time. Models trained on the smaller cropped images were at least twice as fast as our baselines.
We further extract sample saliency maps from random training sessions to illustrate the explainability of our approach. In Fig. 4 we depict a sample fundus image along with the activation of each of the network branches. The saliency maps are indicative of present signs of papilledema in accordance with our analysis and were clinically verified. Specifically, the augmented-red channel activation highlights a superotemporal cotton wool spot, which is a sign of papilledema, similar to retinal structures that are shown brighter in the red channel. The augmented-green channel map corresponds to swelling of the retinal nerve fiber layer, best seen on the nasal aspect of the optic nerve. These activations are stronger in the respective branches than on the non-augmented branch, shown in Fig. 4b.
Our study has limitations as well. As mentioned above, the utilized dataset is still of small scale and, as a result, the proposed algorithms were implemented using repeated cross-validations, extensive regularization and largely frozen pretrained backbones, in order to avoid overfitting and false within-subject correlations. This poses questions regarding the generalization capability of the model, however we expect that the suggested augmentation scheme and multiobjective training will scale efficiently as new data populate our database [22]. Moreover, it is a reliable assisting model in cases of data scarcity. Another limitation concerns the absence of image metadata like biomarkers or optic disc masks that could help substitute handcrafted detection with an automatic machine learning process. Nevertheless, our proposed approach still shows robust performance against the baselines and offers proof of concept.

CONCLUSION
In this study we presented a deep learning-based approach for the challenging task of detecting and differentiating pediatric papilledema from pseudopapilledema in fundus images. We constructed an interpretable system based on clinical papilledema indicators that could be used as a trustworthy screening assistant in the hands of experts. We proposed an unsupervised algorithm for optic disc detection and a contrastive training strategy to unveil important features through deep learning. The obtained results suggest that our system is capable of detecting true papilledema at an accuracy that is comparable to clinical standards. In the future we will expand our database and scale our framework to assess its robustness. We also intend to ground our study on clinical indicators using fine-grained annotations, that would allow more explicit evaluation.