# Retinitis Pigmentosa Classification with Deep Learning and Integrated Gradients Analysis
## 1 Introduction  
Inherited retinal diseases (IRDs) are genetic disorders that impair the function of photoreceptors and the retinal pigment epithelium, often leading to progressive vision loss and blindness [1, 2]. Retinitis pigmentosa (RP) is the most prevalent, characterized by night blindness, peripheral vision loss, and eventually central vision decline [3]. RP can be categorized into non-syndromic RP or syndromic RP, and both types can be caused by various genes, demonstrating this disease's genetic complexity and variability [4]. Non-syndromic RP manifests solely in the retina, with clinical features such as bone spicule-like pigmentation, narrowed retinal arterioles, optic disc pallor, cataracts, and vitreous cell presence [5]. In contrast, syndromic RP is associated with systemic conditions affecting other body parts, such as hearing loss in [PERSON] syndrome or kidney issues in Bardet-Biedl syndrome [2]. Treatment advancements heavily rely on identifying the specific genes responsible for these conditions. This process involves discovering new genes and screening for mutations in individuals and families affected by RP [6]. Despite its inherent complexity, significant strides have been made in identifying the genes and mutations associated with RP. Depending on the RP subtype and the diagnostic technology employed, mutations can be detected in up to 80% of cases using state-of-the-art genetic testing [7]. Retinal imaging modalities have revolutionized the diagnosis and management of IRDs, and technologies such as fundus autofluorescence (FAF) and spectral-domain optical coherence tomography (SD-OCT) enable detailed visualization of retinal structures, facilitating the identification of disease-specific patterns. FAF, for instance, highlights lipofuscin accumulation in the retinal pigment epithelium, revealing areas of photoreceptor dysfunction and oxidative stress [8; 9]. Machine learning (ML) models, particularly deep learning techniques, offer promising solutions for automating the classification of retinal images and identifying genetic variations associated with RP, being able to analyze vast amounts of imaging data to detect subtle features indicative of specific genes, potentially enhancing diagnostic accuracy and accessibility [10]. One notable work in this area is the Eye2 Gene study, which achieved an impressive top-5 accuracy of 85.6% in classifying retinal images based on 36 genes in IRDs from 44,817 scans. The study demonstrated how machine learning could enhance diagnostic precision, particularly when applied to large datasets. Our study builds upon this by utilizing a smaller dataset, directly comparing classification performance, and addressing the challenges posed by smaller datasets [11]. These models' importance is increased when considering the scarcity of available public data about these diseases and the existence of different modalities of retinal imaging that go from fundus photography with 30 degrees of field of view up to Optos Ultra-Widefield with 200 degrees [12; 13]. In this study, we utilized a private dataset provided by two Portuguese public hospitals, which included autofluorescence retinal images from patients with syndromic or non-syndromic RP and a total of 66 genes. State-of-the-art deep learning models were applied to classify these images according to the associated causing gene and category of RP. Additionally, we employed an Explainable AI (XAI) technique known as integrated gradients (IGs) to generate explanatory maps, helping to identify and mitigate potential biases in the models [14]. The results demonstrate the efficacy of deep learning in automatically classifying retinal images for different genes of RP. By integrating IG, we enhanced the interpretability of the models, providing insights into the decision-making process and ensuring the reliability of the results. This approach represents a significant step towards improving the diagnosis and understanding of inherited retinal diseases through advanced imaging and artificial intelligence.