scieee AI-readable full text Open interactive document viewer

Deep learning interpretability methods for the classification of blood cell images

Hernández Uptegrove, Esteve-Amadeu

Abstract

Durant l’última dècada, el sector mèdic ha adoptat les xarxes neuronals com a eina per ajudar a diagnosticar i comprendre diferents malalties, degut a la seva elevada precisió i versatilitat. No obstant, la seva integració al flux de treball dels patòlegs s'ha vist greument afectada per la naturalesa “Black-Box” que presenten aquests models. Els complexos conceptes matemàtics i estadístics en què es basen aquests models, dificulten enormement la comprensió directa dels criteris de decisió en el qual es basen per fer les seves prediccions. La interpretabilitat de xarxes neuronal té com a objectiu proporcionar explicacions en termes comprensibles a un ésser humà. En aquest projecte, es duu a terme un estudi d’interpretabilitat a la xarxa DisplasiaNet, una xarxa neuronal convolucional especialment optimitzada per classificar les imatges de neutròfils sanguinis perifèrics en Normals o Displastics. Treballant estretament amb patòlegs i amb l’ajut d’una aplicació d’anotacions web construïda a propòsit, s’extreuen les principals característiques morfològiques dels diferents estats cel·lulars. En paral·lel, s’apliquen tècniques d’interpretabilitat d’imatges a la xarxa DisplasiNet, com ara mapes de saliència, mapes d’activació de classes i mapes de sensibilitat envers l’oclusió, per obtenir les caracteristiques que el model considera més rellevants. L'estudi ha descobert que DisplasiaNet detecta displàsia en neutròfils de manera similar als patòlegs, validant així la seva precisió. En primer lloc, es centra en la granularitat del citoplasma i, en segon lloc, en la densitat cromatínica del nucli i la segmentació lobular.

Full text

Universitat Politècnica de Catalunya Barcelona East School of Engineering (EEBE) Master's degree in Interdisciplinary and Innovative Engineering DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELL IMAGES MASTER’S DEGREE FINAL PROJECT Report and Annexes Author: Steve A. Hernández Uptegrove Director: Raúl Benítez Iglesias Co-Director: Jose Julian Rodellar Benede Convocatoria: September 2021 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS i Abstract During the past decade, the Medical Sector has widely adopted Neural Networks as a tool to help diagnose and to further understand different diseases. This is due to their proven high accuracy and versatility. However, its integration into the pathologists' workflow has been severely affected due to the black box nature these models present. The complex mathematical and statistical concepts these models are based on greatly hinder the direct understanding of the model's decision criteria when these perform predictions. Neural Network Interpretability aims to provide explanations in understandable terms to a human. In this project, a deep learning interpretability study is carried out on DisplasiaNet, a Convolutional Neural Network specially optimized to classify Peripheral Blood Neutrophil images into Dysplastic or Normal. Working closely with expert pathologists and with the help of a purposely built web annotation app, the main morphological characteristics of the different cell states are extracted. Image interpretability techniques such as Saliency Maps, Class Activation Maps, and Occlusion Sensitivity Maps are applied to DisplasiaNet to obtain the features the model considers the most relevant. The study has found that DisplasiaNet detects dysplasia in Neutrophils in a similar manner to expert pathologists, thus validating its accuracy. Firstly it focuses on the granularity of the cytoplasm, and secondly on the nucleus chromatinic density and lobular segmentation. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS ii Resum Durant l’última dècada, el sector mèdic ha adoptat les xarxes neuronals com a eina per ajudar a diagnosticar i comprendre diferents malalties, degut a la seva elevada precisió i versatilitat. No obstant, la seva integració al flux de treball dels patòlegs s'ha vist greument afectada per la naturalesa “Black-Box” que presenten aquests models. Els complexos conceptes matemàtics i estadístics en què es basen aquests models, dificulten enormement la comprensió directa dels criteris de decisió en el qual es basen per fer les seves prediccions. La interpretabilitat de xarxes neuronal té com a objectiu proporcionar explicacions en termes comprensibles a un ésser humà. En aquest projecte, es duu a terme un estudi d’interpretabilitat a la xarxa DisplasiaNet, una xarxa neuronal convolucional especialment optimitzada per classificar les imatges de neutròfils sanguinis perifèrics en Normals o Displàstics. Treballant estretament amb patòlegs i amb l’ajut d’una aplicació d’anotacions web construïda a propòsit, s’extreuen les principals característiques morfològiques dels diferents estats cel·lulars. En paral·lel, s’apliquen tècniques d’interpretabilitat d’imatges a la xarxa DisplasiNet, com ara mapes de saliència, mapes d’activació de classes i mapes de sensibilitat envers l’oclusió, per obtenir les característiques que el model considera més rellevants. L'estudi ha descobert que DisplasiaNet detecta displàsia en neutròfils de manera similar als patòlegs, validant així la seva precisió. En primer lloc, es centra en la granularitat del citoplasma i, en segon lloc, en la densitat cromatínica del nucli i la segmentació lobular. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS iii Resumen Durante la última década, el sector médico ha adoptado ampliamente las redes neuronales como una herramienta para ayudar a diagnosticar y comprender diferentes enfermedades. Sin embargo, su integración en el flujo de trabajo de los patólogos se ha visto gravemente afectado debido a la naturaleza “Black-Box” que presentan estos modelos. Los complejos conceptos matemáticos y estadísticos en los que se basan estos modelos dificultan enormemente la comprensión directa de los criterios decisivos que el modelo emplea para realizar predicciones. La interpretabilidad de redes neuronales tiene como objetivo proporcionar explicaciones en términos comprensibles para un ser humano. En este proyecto, se lleva a cabo un estudio de interpretabilidad de la red neuronal DisplasiaNet, una red convolucional especialmente optimizada para clasificar imágenes de neutrófilos de sangre periférica en displásicas o normales. Trabajando en estrecha colaboración con patólogos expertos y con la ayuda de una aplicación de anotación web expresamente diseñada, se extraen las principales características morfológicas que presentan los diferentes estados celulares. En paralelo se aplican a DisplasiaNet técnicas de Interpretabilidad de redes neuronales especializadas en el análisis de imágenes tales como Mapas de relevancia, Mapas de activación de clases y Mapas de sensibilidad de oclusión para obtener las características que el modelo considera más relevantes. El estudio ha encontrado que DisplasiaNet detecta displasia en neutrófilos de manera similar a los patólogos expertos, validando así su precisión. En primer lugar, se centra en la granularidad del citoplasma y, en segundo lugar, en la densidad cromática del núcleo y la segmentación lobular. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS iv Acknowledgments First and foremost, I would like to thank my tutors Raul Benitez and Jose Rodellar, for all the time spent throughout the numerous meetings to help me structure and guide me with this project. I cannot express my gratitude enough to Andrea Acevedo for allowing me to continue working on DisplasiaNet and helping me gain profound knowledge on the motivations, procedures, and inner workings of the model. A sincere thanks also goes out to Dr. Anna Merino from the Hospital Clinic de Barcelona. The insightful view given from the perspective of a Medical Doctor has allowed me to further understand the required symbiosis between engineering and science in order to solve real-life medical problems. The many explanations given to me regarding different Haematological aspects have awakened a fascination for biological interactions. This reality has also motivated me to pursue and obtain a more profound knowledge on this matter and learn how to apply Machine Learning to aid in diagnosing diseases faster and more accurately. Special gratitude goes out to my classmates, especially Valentino Asole, for the many hours spent debating, problem-solving, and keeping each other company while grinding away on the project. With this project, I finalize my Master's degree in Interdisciplinary and Innovative Engineering. A profound, heartfelt thanks goes out to my family: Amadeu, Sue, Christie, Brian, Elena and, Baldo, to whom without their unconditional support, I would not have been able to complete. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS v Table of contents ABSTRACT _______________________________________________________________________ I RESUM _________________________________________________________________________ II RESUMEN _______________________________________________________________________ III ACKNOWLEDGMENTS _____________________________________________________________ IV TABLE OF CONTENTS _______________________________________________________________V GLOSSARY _____________________________________________________________________ VIII LIST OF FIGURES _________________________________________________________________ IX LIST OF TABLES __________________________________________________________________ XI LIST OF EQUATIONS _____________________________________________________________ XII INTRODUCTION _______________________________________________________________ 13 1.1. Background ........................................................................................................................................... 14 1.2. Project objectives ................................................................................................................................... 15 1.3. Project Scope .......................................................................................................................................... 15 1.4. Understanding Dysplasia in Neutrophils .......................................................................................... 16 What are the Myelodysplastic syndromes? ................................................................................. 16 The Neutrophil................................................................................................................................ 18 Morphology of a Normal Neutrophil ........................................................................................... 18 Morphology of a Dysplastic Neutrophils ..................................................................................... 19 1.5. Understanding DisplasiaNet ................................................................................................................21 The database.................................................................................................................................... 21 Architecture ..................................................................................................................................... 23 Evaluation and Result Interpretation ...........................................................................................26 1.7. Understanding Neural Network Interpretability .............................................................................28 Why is Neural Network interpretability needed? ..................................................................... 28 STATE OF THE ART _____________________________________________________________ 32 2.1. Interpretability techniques .................................................................................................................. 32 Feature Analysis .............................................................................................................................. 33 Model Inspection ............................................................................................................................ 33 Saliency Maps .................................................................................................................................. 34 Occlusion Sensitivity Maps ........................................................................................................... 35 Proxy Methods ................................................................................................................................ 36 2.2. NN interpretability in Medical Applications..................................................................................... 36 METHODOLOGY _____________________________________________________________ 38 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS vi 3.1. Interpretability study dataset .............................................................................................................. 38 3.2. Cell annotation APP ............................................................................................................................. 39 3.3. Feature Maps ......................................................................................................................................... 41 3.4. Low dimensionality projection of the deep features ........................................................................ 43 3.5. Saliency Maps ....................................................................................................................................... 44 3.6. Occlusion techniques ........................................................................................................................... 45 Occlusion Sensitivity Maps (OSM) ............................................................................................. 46 Local Interpretable model-agnostic explanations(LIME)......................................................... 48 3.7. Class Activation Maps (CAM) ............................................................................................................ 48 Grad-CAM ...................................................................................................................................... 49 Grad-CAM ++ ................................................................................................................................. 50 Score-CAM...................................................................................................................................... 50 3.8. Background generalization test .......................................................................................................... 52 SOFTWARE IMPLEMENTATION ___________________________________________________ 53 4.1. Cell Annotation App ............................................................................................................................ 53 GUI Application Description......................................................................................................... 53 Annotation procedure .................................................................................................................... 55 Docker Installation ......................................................................................................................... 57 4.2. Interpretability Study ........................................................................................................................... 58 RESULTS _____________________________________________________________________ 61 5.1. Cell Annotation App results ................................................................................................................ 61 5.2. DisplasiaNet Score vs Cell Annotation APP score ............................................................................62 5.3. Low dimensionality projection of the Deep features ...................................................................... 64 5.4. Feature Maps ......................................................................................................................................... 65 5.5. Saliency maps ....................................................................................................................................... 66 5.6. Occlusion Sensitivity Techniques ..................................................................................................... 68 OSM: Occlusion Sensitivity Map ................................................................................................. 68 LIME: Local interpretable model-agnostic explanations .......................................................... 70 5.7. Class Activation Map (CAM) Techniques ......................................................................................... 72 Grad-CAM ....................................................................................................................................... 72 Score-CAM....................................................................................................................................... 73 5.8. Background Generalisation Test ........................................................................................................ 74 DISCUSSION __________________________________________________________________76 CONCLUSION AND FUTURE WORK _______________________________________________ 78 REFERENCES _________________________________________________________________ 80 ANNEX A. CELL ANNOTATION APPLICATION INSTRUCTIONS ___________________________ 84 ANNEX B. ANNOTATION DATA + DISPLASIANET PREDICTION __________________________ 88 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS vii ANNEX C. IMAGE COLLECTION ___________________________________________________ 89 C1. Study Dataset Images .......................................................................................................................... 90 C2. Saliency Vanilla Maps ..........................................................................................................................92 C3. Smoothgrad Saliency Maps ................................................................................................................ 94 C4. Occlusion sensitivity Maps ................................................................................................................. 96 C5. LIME 102 C6. Grad-CAM Maps ................................................................................................................................. 103 C7. Grad-CAM++ Maps ............................................................................................................................ 106 C8. Score-CAM Maps ................................................................................................................................ 108 ANNEX D. RESULTS OF THE BACKGROUND GENERALIZATION TEST ______________________ 110 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS viii Glossary AI- Artificial Intelligennce AML - Acute Myeloblastic Leukemia ANN- Artificial Neural Network API- Application Programming Interface APP- Application BM – Bone Marrow CAM- Class Activation Mapping CNN – Convolutional Neural Network ConvNet – Convolutional Networks EDTA - Ethylene Diaminetetraacetic acid FLOPs – Floating Point OPerations GDPR- General Data Protection Regulation GUI – Graphical User Interface LIME- Local Interpretable model-agnostic explanations MDS - Myelodysplastic Syndrome MGG - May Gründwald-Giemsa ML – Machine Learning NN – Neural Network OSM – Occlusion Sensitivity Maps PB – Peripheral blood ReLU – Rectified Linear Unit RGB – Red Green Blue ROC - Receiver Operating Characteristic VPN – Virtual Private Network WHO – World Health Organization DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 15 Applying NN interpretability methods to DisplasiaNet is the next logical step towards integrating this handy tool into the pathologist’s diagnostics workflow. Understanding the inner works of the NN will not only shed light on the decision criteria, but it will also bestow the pathologist and fulfill the ethical and legal requirements of contestability, following article 22. of the EU General Data Protection Regulation (GDPR) “right to explanation” [6]. 1.2. Project objectives This project aims to perform a Deep Learning Interpretability study on the Neural Network DisplasiaNet. This particular CNN detects whether a neutrophil cell image, acquired by microscopy, presents dysgranulopoiesis or not. Therefore, the objective is to prove that DisplasiaNet bases its decision criteria upon the same features as the expert pathologists. By applying different interpretability methods, insights into the inner works of the CNN will become palpable. This acquired understanding must allow us to answer the following questions: Does the NN focus on the same features as the pathologist? Does the NN evaluate the features in the same matter? Is the NN able to generalize? Moreover, can the wrongly classified images provide information on how to improve the NN? The answers to these questions contribute to deem the NN with Transparency, Explainability, and Reliability as the ultimate goal is to build enough trust to be able to integrate such a tool into the medical diagnosis workflow. 1.3. Project Scope 1.- The starting point of this project is the doctoral dissertation by Andrea Acevedo [5]. As such, the first step is to understand the architecture of the CNN, DisplasiaNet, as well as how it was trained and what data was used. 2.- The second step is to acquire knowledge on the disease, Dysplasia, that affects neutrophils. The aspect we are primarily interested in is the morphological features that expert Haematologists use to discern whether a cell presents dysplasia or not. Based on this knowledge, a python based online app is created to document the process of diagnosing a cell with dysplasia. In collaboration with Anna Merino from the Hospital Clínic de Barcelona, a carefully selected neutrophil cell image repository is diagnosed, annotating key areas on each image and scoring the different features. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 16 3.- The third step is to apply different NN interpretability methods to the NN. Several aspects are to be analyzed. These include gaining insights into the different convolutional filters to understands which features the NN has learned to identify to further classify an image as normal or dysplastic (Class Activation Maps)—backpropagating the algorithm to identify what pixels of the image have been decisive in classifying the image (Saliency Maps). Occluding regions of the input image to locate what regions affect the classification the most (Occlusion Sensitivity Maps). As well as performing gradient ascent to locate critical features in the image during classification (Gradcam). Apart from these methods, images with the background cells removed will also be analyzed to prove the NN focuses on the neutrophil in order to perform the classification. 4- Finally, a comparison between the information gathered with annotation application from the expert pathologist and the information gathered from the interpretability methods is performed to establish a common ground for the decision criteria. This step will prove or refute if the NN can correctly classify Dysplastic Neutrophils and help convince the officials in charge to add DisplasiaNet as a support tool for the diagnostic of Myelodysplastic Syndromes(MDS) 1.4. Understanding Dysplasia in Neutrophils The detection of Dysplasia in Neutrophil cells is an important indicator of MDS. As such, the morphology of a normal neutrophil and the morphology of a dysplastic Neutrophil will be overviewed. Most of each condition's characteristic features will be discussed to understand the procedure an expert pathologist uses to diagnose these cells visually. What are the Myelodysplastic syndromes? Myelodysplastic syndromes (MDS) are a group of disorders characterized by abnormal development of one or more of the hematopoietic lineages generated in the bone marrow. These are constituted by a variety of morphological, immunophenotypic functional, and genomic alterations. These alterations appear during the cell differentiation and maturation stage, classifying them as clonal hematologic diseases. These syndromes have in common an ineffective Myelopoyesis, production of the Myeloid lineage cells (Figure 1), which lead to cytopenias, reduction in the number of mature blood cells, and medullary aplasia, failure of the bone marrow to function normally. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 17 MDS are usually observed in patients over 50 with a typical onset age of 70 years [7] and more frequently amongst men. The symptoms include infections, bleeding and up to 30% of the cases turn into acute myeloblastic leukemia (AML) [3]. The primary etiology of MDS is unknown, although there is a genetic and environmental component linked to it, such as some hematological diseases (aplastic anemia, nocturnal paroxysmal hemoglobinuria, etc.), genetic disorders (Down syndrome, congenic disquerasitosis, etc.), exposition to toxic substances (benzene, metals, etc.), or specific treatments (chemotherapy, radiotherapy) [8]. Figure 1. Hematopoietic cell classification source: [9] To diagnose MDS, medical experts rely on differential diagnostics by comparing BM aspirate, BM biopsy, Blood tests, and the patients' medical records. Complete blood counts parameters, flow cytometry, genetic studies, BM morphology evaluation, and dysplasia in blood and bone marrow follow guidelines established in the WHO MDS 2016 classification [9]. Blood smear microscopic examination is a low-expensive and easily accessible tool for the assessment of cell abnormalities. It has a relevant role in supporting the initial MDS diagnosis since dysplasia is observed in one or more major myeloid lineages. Out of the three major myeloid lineages, dyserythropoietic and megakaryocyte, morphological alterations are more apparent in BM. Instead, dysgranulopoiesis, more apparent in PB. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 18 The Neutrophil Neutrophils along with Eosinophils and Basophils, constitute a group of Leukocytes (white blood cells) known as Granulocytes. These are mature blood cells derived from the Myeloid lineage of the Hematopoietic stem cells (blood stem cells) (Figure 1). Leukocytes are an integral part of the body's immune system, allowing it to fight infections and other diseases. Neutrophils are the most abundant type making up from 40 to 70 percent of them [10]. These are short-lived and are produced within the bone marrow through stimulation with granulocyte colony-stimulating factor. Unlike other Leukocytes, Neutrophils are not bounded to a specific circulation area; these have the capability of moving freely through the blood vessel walls into other tissues in the body to attack antigens. It is also worth noting that once the neutrophil has left the blood vessels, it does not return to them dying at the infection site, contributing to the formation of the whitish exudate called pus. [10] Morphology of a Normal Neutrophil Neutrophils are fairly uniform in size, with a diameter varying between 9 and 15 µm. Contrary to Erythrocytes (red blood cells) and Thrombocytes (platelets), Leukocytes are endowed with a nucleus. These have a single polymorphic-shaped nucleus consisting of two to five lobes chainconnected by a thin chromatin filament. This relatively small nucleus occupies about 21% of the cell’s volume and is densely packed with chromatin which disappears as the cell reaches the end of life [11]. The cytoplasm of the neutrophils contains numerous granules with different morphologies. The primary granules, often larger and rounder in size, contain microbicidal agents. Other smaller granules, called secondary granules, house enzymes such as lysozyme, gelatinase, collagenase, and many others. These allow the cell to move fast through the different tissues as well as perform the basic functioning need for the cell to maintain alive. [12] Once the neutrophil has been stained through the process of the May Grünwald-Giemsa protocol, the granules acquire a purple-to-lilac color, the cytoplasm acquires a pale pink color, and the nucleus acquires a deep blue-violet color. Upon further inspection under a microscope, the nucleus should present a homogeneous stain, primary granules should be a distinct Azure color, and Secondary granules should present a salmon pink color. Figure 2 contains a representative normal neutrophil used in the study. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 19 Figure 2.A. Healthy Neutrophil. (TN_SNE_14872673.jpg) B. Healthy Neutrophil. (SNE_131893). Source: [14] Morphology of a Dysplastic Neutrophils An unhealthy neutrophil can present several morphological features that pathologists use to determine dysplasia in the granulocytic lineage [8] [13]. These features can be presented in both the nucleus and the cytoplasm. Cytoplasmic hypogranularity or agranularity is considered a particular dysplastic feature. It is represented by a reduction of at least 2/3 of the granules in the cytoplasm (Figure 3Error! Reference source not found..A). Bear in mind that a subpar staining procedure might induce the agranularity of a sample ocasionally. Nonetheless, when it occurs, all the neutrophils present in the smear are hypogranular. Other dysplastic features that might be present in the cytoplasm are Dohlë bodies. These inclusions correspond to agglutinated ribosomes that present themselves as a light blue-colored region in the outer part of the cytoplasm of the neutrophil. It is shown in Figure 3.B and Figure 3.C Figure 3.A. Agranular Cytoplasm (SNE_1901668.jpg) B. Dohle body (MMY_780452.jpg) C. Dohle Body (SNE_769084.jpg). Source: [14] DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 20 The most characteristic features related to the nucleus are linked to the lobe segmentation. Hiposegmentation is expressed when the nucleus presents less than three lobes. Often this feature is related to the pseudo-Pelger-Huët nucleus(Figure 4.A.), a bilobed nucleus shaped like a dumbbell and containing a coarse and lumpy structure. In other cases, the nucleus has not segmented at all and presents a chromatinic density proper to more mature neutrophils (Figure 4.B.). Figure 4.A.PseudoPelger-Huët Nucleus.( WD_SNE_2683958.jpg) B. Hiposegmented Nucleus (WD_SNE_2426196.jpg). Source: [14] Another common nucleus dysplastic feature is Hipersegmentation, given when the nucleus contains more than five lobes (Figure 5.A), or “ring nucleus” (Figure 5.B). Band neutrophils are frequent in infections and may present themselves as hypogranular in MDS (Figure 5. C ). Figure 5. A.Hipersegmented Nucleus (SNE_1896407.jpg) B. Ring Nucleus (SNE_741882.jpg) C. Band Nucleus (BNE_1841329). Source: [14] Other factors to consider when inspecting a neutrophil nucleus are the presence of nuclear appendixes, abnormal chromatin density, abnormal chromatin clumping, and abnormal segmentation patterns such as Mielocatexis. Ultimately, the most important characteristics when diagnosing a cell will dysplasia are: Hipogranularity/Agranularity of the cytoplasm, Hiposegmentation/Hypersegmentation of the nucleus, and the chromatinic aspect of the nucleus Homogenic/Heterogenic. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 21 1.5. Understanding DisplasiaNet The following chapter aims to present the reader with knowledge on the object of study, the CNN model: DisplasiaNet. DisplasiaNet is one of the contributions made by A. Acevedo's doctoral Thesis, Deep Learning System for the Automatic Classification of Normal and Dysplastic Peripheral Blood Cells as a Support Tool for the diagnosis [5]. This CNN has been developed with the aim of being integrated into the Hematological laboratory workflow as a support tool to classify PB Neutrophil images into dysplastic or normal. Firstly, the dataset used to train, test, and evaluate the model will be overviewed. This section will detail the conformation of the dataset as well as some representative statistics. Secondly, the architecture of the CNN will be presented. This information will be expanded to contain conceptual knowledge on NN theory. To sum up, the final results and the criterion to interpret the model's output will be briefly discussed. This whole chapter is based on A. Acevedo’s doctoral thesis [5] and the resulting articles from it [14]. The database A neural network is a series of complex algorithms that endeavor to recognize underlying relationships in a dataset. This dataset is the object of study, and by learning to identify and relate its underlying features enables us to make predictions on new images. As so, the dataset needs to be a representative sample of the data we want to predict. Larger datasets are an advantage as variability will be captured better. All datasets for image classification, like DisplasiaNet, must contain the study images and an additional annotation file stating what class the image belongs to. The database used to train DisplasiaNet contains 20,670 images of neutrophil blood cells of which, 8,676 belong to dysplastic cells, and 11,994 belong to normal cells. All the images were gathered by the Hematological department at the Core Laboratory of Hospital Clinic of Barcelona. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 22 A group of expert clinical pathologists selected and labeled the images according to their morphological characteristics. Patients' diagnostics (ground truth) were confirmed by integrating all supplementary test results: clinical data, PB and BM (Bone Marrow) morphology, flow cytometry, cytogenetics, and molecular biology following WHO 2016 classification of tumors of hematopoietic tissues [9]. The images were extracted from a total of 249 peripheral blood (PB) smears from 144 different patients. Peripheral blood is the blood that travels through the heart, arteries, capillaries, and veins. A blood smear is a blood sample, usually extracted from a vein, that is tested on a specially treated slide. The process to obtain the images is as follows. The smears are collected in tubes containing Ethylene Diaminetetraacetic Acid (EDTA), an anticoagulant used to maintain the blood in a fluid state during hematological testing. The smears are then processed by the Sysmex (Kobe, Japan) SP- 10i automatic slide maker and stainer. This automatic process ensures a constant preparation of slides and eliminates any human variability and error. The protocol used to stain the cells is the May Grünwald-Giemsa staining protocol (MGG). This staining process helps to visually differentiate the different blood and cellular components employing azurite dyes. Each individual neutrophil image is automatically captured employing CellaVision®DM96 (CellaVision, Lund, Sweden), a powerful microscope that is able to locate and pre-classify blood cell types. The output are RGB images of 360x360 px. These images usually contain a single neutrophil cell located in the center that covers 16% of the image. The background usually contains several red cells and occasionally platelets (Figure 6). Figure 6. Examples of the dataset images: dysplastic cell(right), normal cell (left). The Neutrophil cell is in the center of the image. Red blood cells conform the majority of the background. Platelets can occasionally be observed, represented as smaller lilac colored isolated structures. Source: [14] DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 23 The dataset has been split into the training set (23.27%), the validation set (4.84%) and the test set on individual images(4.84%). Parallelly another test set was used to test 113 different blood smears of 72 patients (31.70%). The remaining 35.36% was used for the proof of concept by analyzing 116 complete blood smears from 72 different patients. Architecture DisplasiaNet is a Convolutional Neural Network (CNN). This type of artificial neural network has the capability of recognizing and classifying particular features from images and is currently one of the best performing architectures for image analysis. DisplasiaNet presents the advantage of being a relatively lightweight model consisting of only 72,977 trainable parameters. Usually, other pre-trained image processing CNN such as VGG16 or AlexNet, contain 138.4 million and 62 million trainable parameters, respectively. The number of trainable parameters directly affects the computational power required to perform a forward pass measured in FLOPs (Floating Point OPerations). DisplasiaNet requires 0.207 GFLOPs as opposed to VGG16 that requires 15.3 GFLOPs, and AlexNet that requires 1.5 GFLOPs A typical CCNs architecture contains a convolutional block followed by a dense block. The convolutional block is the one in charge of detecting and highlighting special features in the input image. The dense block performs an interpretation of the highlighted features and performs the actual classification. Specifically, DisplasiaNet is conformed by four convolutional blocks, a flattening layer, and a Dense block containing two fully connected layers. The input layer accepts RGB images with a dimension of 299x299 px, and contains a total of 268203 neurons. The output layer contains one single neuron, which returns a value ranging from 0 to 1. This value can be interpreted as a probability distribution, where an output close to 0 indicates a higher chance of the image containing a dysplastic cell; otherwise, a value closer to 1 contains a normal cell. (Figure 7). DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 24 Figure 7. DisplasiaNet Architecture. Source:[3] Each convolutional block is composed of a Convolutional Layer, an activation layer and a Max Pooling layer. The convolutional layer of a CNN, named after the mathematical operation it performs (convolution), convolves the layer's input through the repeated application of the same filter resulting in an activation map. During the training stage of the NN, the filter is modified and adjusted automatically through the backward propagation operation, to highlight specific attributes in the image. For low-level convolutional layers these might be straight lines, circles, or spots; instead, for higher-level layers it might be able to detect textures and specific irregular geometries. DisplasiaNet applies sixteen 3x3 px convolutional filters, or kernels, on each convolutional layer. The output of each layer are sixteen specific feature maps. Each one highlights the specific feature each filter has specialized in. Also, as a consequence of the convolutional operation, the output is 2 px smaller than the input on each axis. This information is important as it will be needed to properly overlap the feature maps on the input images later on during the analysis. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 31 achieve. This is the case for image analysis, where the variables are not directly palpable, and features are described by groups of pixels. Consistency refers to the uniformity between explanations in the sense that there are no contradictions. In Interpretability, the No-Free-Lunch theorem applies, meaning there is not a universal technique for each type of problem. This implies that several interpretability techniques must be contrasted to achieve an overall picture of the decision criteria of the model. Completeness considers how well the explanation fits the data. From a mathematical perspective, a NN learns to maps the input to the output in the best way possible. A reasonable interpretation must be applicable to the maximum number of data instances. Universality describes, in a sense, the rapid growth of the interpretability knowledge domain. Finding a universal interpretation that deciphers as many models as possible can ease up the task of explaining the decision on criteria of the model by saving time and labor. Last but not least Reward. The interpretability methods must be able to provide gains to the understanding of the network. In addition to aiding users' trust, the results should be report improvements, where allowed, to the architecture or training of the model. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 32 State of the Art ML interpretability has gathered much attention through the past couple of years due to the increased need to prove their underlying decision criteria. As such, many interpretability methods have been developed to cope with this need. It is important to notice that different types of input data require different methods to make sense out of the NN. This section is divided into two main parts. A first part where different interpretability techniques are discussed, and a second part that discusses the implementation of these techniques in vanguard applications. All the research stated will be carefully tailored to suit the application of the problem stated in this project. 2.1. Interpretability techniques Being NN interpretability a fairly recent domain knowledge, experts have not reached a consensus regarding a clear taxonomy to properly classify DL interpretability techniques. The most common classification are: Pre-model vs. In-model vs. Post-model; Intrinsic vs. Post-Hoc; Model-Specific vs. Model Agnostic; and Result of explanation methods. However, the chosen classification for this section will be Intrinsic vs Post-hoc, as it is the one that relates the most to the problem stated in this project. Nonetheless, the Model specific vs the Model agnostic features of each technique will be discussed as it is important to consider the implications of each type. Post-hoc interpretability techniques are those that are applied to a model after this one has properly been trained. These techniques do not compromise the precision of the model since the prediction, and the interpretability are two independent processes without mutual interference. Nonetheless, no model can represent with 100% accuracy any other model as interpretation would become the original model. This fact attributes these techniques to be slightly inaccurate and require further comprehension. Despite their slight inaccuracy, they are also the easiest to interpret. On the contrary, Intrinsic models eliminate the bias of the post-hoc techniques. This is since these techniques must be considered in the architecture development phase. These models restrict the complexity of the model and are considered interpretable due to their simple structure. This tradeoff is usually represented in a loss of accuracy. Examples of these techniques are Liner regressions, Logistic regressions, Decision Trees [25], k-nearest neighbor [26], and the Naïve Bayes Classifier DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 33 [27]. Due that these techniques do not apply to our current model, no further explanation will be made. Feature Analysis Feature Analysis interpretability techniques focus their analysis on visualizing and comparing the different structures the model is composed of. Through the process of visualizing layer outputs and specific neurons, sensitive features and the ways the model processes data can be explained to some extend. These techniques provide qualitative insights into the NN in following a model agnostic approach. Nonetheless, these techniques lack an in-depth, rigorous, and undefined understanding. The most straightforward approach for models that handle images is the method described by F.Chollet in [28]. This method, Intermediate Feature Maps, aims to visualize the internal features of CNN in a global matter. The output values for the different convolutional, pooling and activation layers can be obtained by feeding an input image to the model. As convolutional networks maintain spatial information, these outputs can be arranged to match the structure of the input image. As a result, a Feature map is obtained for each filter in the convolutional layer. These maps, usually represented as a heat map, highlight the structures of the input image that the filter considers to be relevant. From this method, we can extract knowledge on what image-specific features the model is considering to perform its prediction. Numerous methods, [29] [30] [31], explore different strategies of generating synthetic input images devoted to maximizing the output of a NN or target structures of the model. The resulting images are popularly called ‘deep dreams’ as these depict what the ‘dream’ on the NN is supposed to be. In this image key structures for the different classes can be identified. Another approach is the one by M.D. Zeiler et al. [32]. This paper describes the design of a deconvolution network consisting of unpooling, rectifying, and deconvolutional operations to be paired with the original convolutional network. This method aims to reconstruct an image from the information stored in the convolutional layers without purposely retraining the network. The reconstructed image allows identifying what features are being removed by the original convolutional model compared to the original input image. Model Inspection Model Inspection works in a similar mater to feature analysis inspection; however, these methods apply external algorithms to dive into the NN inner workings to extract important structural and DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 34 parametric information. The application of analytical tools such as statistics deems these methods more trustworthy and rewarding. A first initial approach is CAM [33] (Class Activation Mapping). This method bases its explanation on the weights of each filter on the last convolutional layer adopt towards an individual prediction. This method requires modifying the network by removing the fully connected layers (FC) present at the end of classic CNN architectures and substituting and training it with one FC layer with the softmax activation function. The output of the different filters on the last convolutional block are weighted and added, and finally overlaid on the input image. This highlights the relevant features detected by the convolutional blocks and how they affect the prediction. Grad-CAM [34] was posteriorly developed by combining the class conditional property of CAM with pixel-based gradient backpropagation returning better results. However, this method lacked stability, as when several occurrences of a class were present, its performance dropped, and single for object images, the method failed to highlight the whole region on the heat map. Grad-CAM++ [35] remedies the flaws as mentioned above of its predecessor by adding a pixel-wise weighting distribution on the final convolutional feature map. Finally, ScoreCAM [36] achieves a better visual performance with less noise and offers better stability than Grad-Cam and Grad-CAM++. This is achieved by replacing the gradient-based weight with a score-based weight that has a much smoother curve of change. An alternative numerical approach is presented by A. Bansal et al. [37] . This paper developed a model agnostic algorithm to identify which instances a neural network is likely to fail to provide a prediction for. This model is to be executed in parallel with the original model. In such scenario, the output of the supporting model would activate when a potential misclassification image is being processed. Y.wang et al. [38] proposed a method of demystifying models by analyzing critical data route paths for different class images. This method would allow to rout each image in the dataset and compare common features amongst them. Saliency Maps Another popular approach for interpreting image classifiers are Saliency Maps. This method is derived from the concept of saliency in images which depicts unique features, such as pixels, of the image which are relevant in the context of visual processing. As such, the output image of this method is a masked with the most relevant pixels for the classification highlighted. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 35 The original method, Vanilla Saliency [39], evaluates the gradient of the class score as a function with respect to the input. In other words, it interprets the gradient as a sensitivity map. The basic concept is to first forward pass the input image through the whole model. The obtained data is then backpropagated all the way to the input data. The usual backpropagating operation performed during training stops at the second layer because there is no interest in changing the input data. As the backpropagation is carried all the way to the input, pixels are highlighted on the input image. The gradient is, in its essence, a list of derivatives, one for each pixel. Smoothgrad [40] is an improved method to generate saliency maps. Its principle relies on the same as Vanilla Saliency; however, several input images are generated by altering the image with Gaussian noise and smoothing filters. Each generated map is feed into the model and backpropagated to the input. The final result is the average of the different obtained maps. This method has been proven to have a denoising effect on the final sensitivity map offering a better visualization. Occlusion oriented Maps Sensitivity Maps can also be generated in a model agnostic matter. These are based on the principle of occluding a part of the input image and evaluating the relevance of that region to the classification via the output score. Occlusion sensitivity maps [32], are one of the first proposed methods. The principle relies on shifting a grey patch of fixed dimensions along the two dimensions of the image, occluding one region at a time. The output score of each of the analyzed images is plotted on a map where the patch has been located. The complete obtained map is a heat map, where high values contribute to a positive classification of the specific class. On the other hand, low values are attributed to features that, when occluded, negatively affect the prediction. To analyze this method, it is necessary to know what the benchmarked score of the image is to have a notion of what affects the model positively and what affects the model negatively. LIME (Local interpretable model-agnostic explanations) [41], approaches this concept in a slightly different matter. The input image is previously segmented to create superpixels. These superpixels are group real image pixels by neighboring colors and structures, obtaining semantic image structures. The image is then iterated several times with a combination of different superpixels blacked out. Ideally, every superpixel combination should be processed; nonetheless, this computation would be highly costly. The class output score of each iteration for each pixel is fitted DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 36 to a linear regression. The top superpixels of the regression should correspond to the most relevant regions of the image. Bear in mind that LIME only evaluates local accuracy. The combination of different features supports predictions in models. SHAP (Shapley Additive exPlanations) [42] is another approach to analyze superpixel-based occlusion. This not only evaluates the local accuracy of the presence of features but also evaluates the missingness of the features and the consistency throughout the iterations. This analysis is achieved by the incorporation of Shapley values [43], derived from game theory, to decide the importance of the different segmented features. Proxy Methods Proxy methods construct a more interpretable simpler proxy that highly resembles the trained, large and complex original model but without the black-box nature. This is achieved by the integration of white-box models such as decision trees and rule decisions. These methods can return predictions in the local space or global solution space. However, the main drawback to this method is that an extra cost is needed to construct this alternate model. 2.2. NN interpretability in Medical Applications The techniques mentioned above are currently being used to study the behavior of different CNNs. The output of the study is employed in different matters. Some are used to highlight features on the input image for the expert pathologist to have more information. In other cases, the information is used to learn more about a particular pathology as the CNN learns features that might be unperceivable by the human eye. Other uses imply learning the most relevant features of a CNN to train a simpler, less computing demanding NN. Some examples are listed below. In P. Van Molle et al. [44] a CNN was trained to classify skin lesions. The feature maps from last two convolutional layers were extracted for each input Image, subsequently being analysed and compared. From this analysis, rules were extracted to aid the pathologists in the decision-making for skin lesion classification. Skin color, skin types, and the border of the lesion responded to different activation maps. In A. Zaritsky et al. [45] a trained convolutional Encoder-Decoder NN generates artificial, exaggerated images of metastatic melanomas. With the use of NN interpretability methods, DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 37 underlying features that can escape the human eye are learned by the pathologists to understand better how to diagnose these melanomas. J.R Zech et al. [46] trained a model to classify patients, based on chest radiographies, into having pneumonia or not. To justify the desition making of the models, different correct and incorrect images were analyzed employing CAM. The results reported that the model occasionally focused on irrelevant features for the disease, such as metal tokens. In Cruz-Roa et al. [47] a CNN is developed to classify if Basal cells presented Carcinoma Cancer. As a peculiarity of the architecture, the model had two outputs, one scoring the probability of the cell presenting cancer and the other not. This fact contributes in a positive way to the interpretability of the model. The authors also highlight the regions that made the model decide on a prediction on the final image (blue for Cancer and red for normal). In S. Pereira et al. [48] brain tumor segmentation CNN was analyzed employing LIME. This application cast local interpretation efforts of the model. In J. Diao et al. [49] a CNN is trained to detect five different types of cancer from different tissue types. From this information, an interpretability study is performed to obtained Human Interpretable Features (HIF). These obtained features are then used to train a simpler Dense NN used by the pathologist to aid in diagnosing the different tissue cancer. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 38 Methodology This chapter discusses the methods employed for performing the NN Interpretability Study. Aspects such as the election of the dataset and the theoretical background of the methods are discussed. 3.1. Interpretability study dataset The first step towards performing a NN interpretability study is the conformation of the dataset. This dataset must be a subset of the images used to train the original CNN, DisplasiaNet [14], as these will tend to better represent the features that the NN has learned to make its predictions. These images are 360x360px in dimension and RGB format, meaning each image can be expressed as a three-dimensional array expressed as 𝑖𝑚=(3,360,360). However, these images need to be down-sampled to 𝑖𝑚=(3,299,299) to match the input layer of DisplaciaNet. As for the images, these need to contain an equal amount of Dysplastic and Normal cells and be a representative sample of the dataset. This means that the selected images must contain: a wide variety of cytoplasmic granulation, varying from agranular to highly granular; a wide variety of nucleic chromatinic densities, varying from heterogenous to homogenous; and different segmentation stages, varying from hypolobulated to hyperlobulated. Other features must also be present in the dataset, such as Dohlë bodies and pseudo-Pelger-Huët nucleus. The meaning of the different features is explained in chapter 1.4, Understanding Dysplasia in Neutrophils. For the images to be as representative as possible, these must be selected alongside the expert pathologist. We must keep in mind that many of the interpretability techniques applied to the image dataset must be analyzed qualitatively. Consequently, employing a small dataset is key to interpreting the output maps efficiently; therefore, the established number of images to be analyzed per class is 23. These contain the 3 images used as examples in the original paper of DisplasiaNet and twenty additional images that represent the class appropriately. Additionally, 5 misclassified images per class are selected to further understand the rationale behind the misclassification. The total amount of images in the dataset is 56 (Table 2). The different images selected have been coded by adding a suffix to the original image name, these are: Thesis Normal cell(TN), Thesis Dysplastic cell (TD), additional Normal cell (ZN), additional Dysplastic cell (ZN), misclassified Normal Cells (WN) and misclassified Dysplastic cell (WD) DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 39 Normal Dysplastic Total Correctly classified 23 23 46 Incorrectly classified 5 5 10 Total 28 28 56 Table 2. Interpretability image dataset. In order to obtain a baseline for comparison, all the images are processed by DisplasiaNet to obtain the output score. 3.2. Cell annotation APP An online web annotation application has been developed to gain a deeper understanding of the workflow the expert pathologist follows to diagnose a Neutrophil with Dysplasia (Figure 9. Cell Annotation APP GUI). This tool enables us to thoroughly document and evaluate the key features of all the images contained in the Interpretability Dataset. Figure 9. Cell Annotation APP GUI In collaboration with the expert pathologist from the Hospital Clinic de Barcelona, and contrasting with the literature review, the three most important features to diagnose a Dysplastic neutrophil have been selected. The following are listed in order of priority: presence/absence of granules in the cytoplasm; the state of how the chromatin is presented in the nucleus; and the number of lobes the nucleus presents. To document how predominant a feature presents itself, a scoring system for each DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 40 of the features has been developed. This scoring system is not based on any existing scoring systems and is merely a scale used to quantify the presence of each feature for each image. Regarding the granularity in the cytoplasm, Normal cells typically present a high granule count, and Dysplastic cells typically present a low or occasionally a null granule count. This feature (𝑆𝑔) is evaluated from -3 for highly granulated to +3 severely hypogranular. As for the chromatinic state of the nucleus, normal cells typically present a homogenous tinction pattern indicating a highly dense nucleus. On the other side, Dysplastic cells typically present heterogenic tinction of the nucleus, indicating a low chromatinic density. This feature (𝑆𝑐) is evaluated from -3 for highly homogenous tinction to +3 for a severely heterogenic tinction. Lastly, the lobular segmentation is evaluated on a binary scale (𝑆𝑙). A score of zero is given if the lobular segmentation is considered normal, between three and five lobules in the nucleus. A score of one is given when the cell presents an abnormal lobular segmentation, hypolobulated (<3 lobes), or hyperlobulated (>5 lobes). Following this criterion, each image of the database should be assigned a total score (𝑆𝑡) between -6 and +7, which corresponds to the addition of the independent feature scoring system (𝑆𝑡=𝑆𝑔+ 𝑆𝑐+𝑆𝑙). Images with a total score higher than 𝑆𝑡≥1 indicate that the image contains a Dysplastic Cell and scores lower than 𝑆𝑡≤1 indicates that the image contains a normal cell. Additionally, the application allows the user to manually segment both the cytoplasm and the nucleus by selecting the freehand drawing tool and tracing over the perimeter of both structures. This segmentation is useful as it can be converted into two independent masks to either isolate the cytoplasm or the nucleus. The application saves an annotation file for each image in *.json format that contains the different independent scores as well as the masks for both the cytoplasm and the nucleus. Cell Annotation APP has been developed using the Plotly/Dash [50] productive web-based python framework, licensed under the MIT License. This framework has enabled us to create a user-friendly application for expert pathologists to annotate the different cell images in a simple, visual and fast matter. The application has been packed into a Docker Image [51] and is licensed under a Docker free license for Education and learning and Non-commercial open-source projects. The Docker DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 47 Figure 13. OSM grey patch 5px, 10px, 20px, 40px [TD_BNE_2249981.jpg (Top), TD_BNE_2256328.jpg (Bottom)] Figure 13 presents OSM with gray patches for two dysplastic cells. The selected patch sizes are 5px2, 10px2, 20 px2, 40px2. As can be observed, small patches return smoother heat maps. However, the utilization of gray patches returns undesired results. The benchmarked score for the top and bottom images without occlusion are 0.966 and 0.954, respectively, for the dysplastic class. It is expected to obtain no difference score difference for the regions where the neutrophil is not present. Instead, when the image's background is occluded, an improvement of up to 4% is recorded for the class score. Nonetheless, a decrease in the score is recorded when the patch is located over the nucleus of the neutrophil, indicating it is a relevant feature for the classification of cells. As explained previously, this method has a significant drawback, mainly induced by the convolutional sector of the model. The color gray is a color that is not typically found in the dataset. Introducing it in a patch can return unexpected results, as evidenced by the previous sensitivity maps. At this point, the color of the patch can be tuned. There are many ways this can be done, Zhong et al. [60] attenuated the original images with random noise for data augmentation and training. As granularity is an important feature, as stated by the pathologic experts, it is not a viable method as it can induce erroneous predictions. Yun et al. [61] substitute the grey patch with a patch located in the same position but from another image. This is not an ideal solution as our dataset is relatively constant regarding the disposition of the image; the image is centered with the cell, and the nucleus is usually found in the center of the image. Therefore, the patch substitution would not modify the image enough. Another option that complies with our objective is to substitute the patch with the mean value of the patch in the original image. This will remove any characteristic texture without introducing new color elements into the image. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 48 Local Interpretable model-agnostic explanations(LIME) A more state-of-the-art occlusion technique is LIME (Local interpretable model-agnostic explanations) [41]. The basic principle of this method is the same as for OSM, where regions are occluded, and the output score is evaluated. A quick image segmentation algorithm generates superpixels that will act as the occlusion patches (Figure 14). When choosing the segmentation algorithm, Quickshift [52] in our case, we aim to maintain the overall geometry of the image without introducing sharp edges into the image. While configuring the segmentation algorithm, we set the different parameters to achieve relatively small areas that cluster pixels in the same color neighborhood. The output is constituted by more ‘natural’ regions that can be found on the cell morphology. These are then replaced by the average color in the superpixel, thus addressing a previous issue. Figure 14. Quickshift superpixel generation (TD_BNE_2249981.jpg) This method also introduces a novel way of iterating the image. Several superpixels can be deactivated simultaneously, unlike the previous method, where only one patch is present in each iteration. We can then configure the probability of a pixel being deactivated and the number of iterations to process the input image. The average number of superpixels in each image after the quick-shift algorithm is 227. Seven hundred iterations of each image are computed where randomly different patched are activated and deactivated. The score for each iteration is then plotted onto a 2d space and fitted with a more straightforward linear model. From this model, we can extract the top superpixels, which, when occluded, affect the most the output result. The features contained in that superpixel are the ones the model focuses on the most when making predictions 3.7. Class Activation Maps (CAM) Class activation maps (CAM) is another approach to visualize what features a DL model uses to perform a specific prediction. In general terms, it is a pixel heat map composed of the different feature maps extracted from the last convolutional layer filters. Different filters react to different DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 49 image features. Combining the highest weighted feature maps can give us a sense of what the model reacts to for certain classes. The original method [33] required the model to be modified by replacing the fully connected layers at the end of the model and replacing them with a single Global Average Pooling layer containing the different class outputs. This substitution aims to have a direct relationship between the last layer convolutional filters and the output classes via the weight each filter is attributed for each class. However, this method has a significant drawback and is that the model is required to be retrained. As the model is being retrained with a simpler architecture, many hidden feature relations are eliminated. Also, from the interpretability analysis point of view modifying the model defeats the purpose. New methods have been developed based on this original method that do not require a model retraining. Some of these are Grad-CAM [34] and Score-CAM [36]. Grad-CAM Grad-CAM [34] is based on the same principle as CAM to obtain the class-discriminative localization map. However, this new methodology (Figure 15) computes the class score's gradient (Eq. 7) with respect to the obtained feature maps from the convolutional layers. The different gradients are then globally pooled across the width and height dimension to obtain the weights of each of the filter channels (Eq. 8). Like CAM, the output map is a weighted combination of the feature maps combined with ReLU (Eq. 9). Finally, the resulting heat map is upscaled to match the Input image dimension. This novel approach generalizes the CAM method and avoids having to modify and retrain the model. 𝜕𝑦𝑐 𝜕𝐴𝑘; 𝑤ℎ𝑒𝑟𝑒 𝐴𝑘→𝐹𝑒𝑎𝑡𝑢𝑟𝑒 𝑀𝑎𝑝 𝐴𝑐𝑡𝑖𝑣𝑎𝑡𝑖𝑜𝑛 𝑦𝑐→𝑐𝑙𝑎𝑠𝑠 𝑠𝑐𝑜𝑟𝑒 (Eq. 7) 𝑤𝑘 𝑐=1 𝑍∑ 𝑖∑𝜕𝑦𝑐 𝜕𝐴𝑖𝑗 𝑘 𝑗; 𝑤ℎ𝑒𝑟𝑒 𝑤→𝐹𝑒𝑎𝑡𝑢𝑟𝑒 𝑊𝑒𝑖𝑔ℎ𝑡𝑠 (Eq. 8) 𝐿𝐺𝑟𝑎𝑑𝐶𝐴𝑀 𝑐=𝑅𝑒𝐿𝑈(∑𝑤𝑘 𝑐 𝐴𝑘 𝑘); 𝑤ℎ𝑒𝑟𝑒 𝑘→𝐹𝑒𝑎𝑡𝑢𝑟𝑒 𝑀𝑎𝑝𝑠 (Eq. 9) DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 50 Figure 15. Grad-CAM methodology scheme (Source: [23]) The literature states that this method lacks stability, as when several occurrences of a class are present, its performance drops, and for single object images, the method fails to highlight the whole region on the heat map. Grad-CAM ++ Grad-CAM++ [35] remedies the flaws mentioned above of its predecessor by reformulating (Eq. 8) by adding a pixel-wise weighting distribution to on the final convolutional feature map (Eq. 10). The weighting coefficients of the pixel-wise gradient only use positive gradients. By doing so, the neuron's output is increased rather than suppressed, capturing the most important visual features. 𝑤𝑘 𝑐=∑ 𝑖∑𝛼𝑖𝑗 𝑘𝑐.𝑅𝑒𝐿𝑈(𝜕𝑦𝑐 𝜕𝐴𝑖𝑗 𝑘) 𝑗 𝑤ℎ𝑒𝑟𝑒 𝛼𝑖𝑗 𝑘𝑐 →𝑝𝑖𝑥𝑒𝑙𝑤𝑖𝑠𝑒 𝑤𝑒𝑖𝑔ℎ𝑡𝑖𝑛𝑔 𝑐𝑜𝑒𝑓 (Eq. 10) This generalized method of Grad-CAM is able to provide better visual explanations of CNN model predictions in terms of better object localization as well as explaining occurrences of multiple object instances in a single image, Score-CAM ScoreCAM [36] offers a different approach to the matter in how the original CAM algorithm is evaluated. This novel method achieves a better visual performance with less noise and offers better stability than Grad-Cam and Grad-CAM++. This is achieved by replacing the gradient-based weight with a score-based weight that has a much smoother curve of change. The basic workflow of Score-CAM can be observed in Figure 16. This method first obtains the different feature maps of the last convolutional layer by forward propagating the image through the DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 51 model (Phase 1) After obtaining the different feature maps, these are up sampled from 16x16px to the original 299x299px dimension of the input image by performing a bilinear-interpolation. The resultant activations maps are normalized within the range [0,1] by employing (Eq. 11). Figure 16. Score-CAM methodology scheme (source:[36]) 𝐴𝑖,𝑗 𝑘=𝐴𝑖,𝑗 𝑘 max𝐴𝑘−min𝐴𝑘 𝑤ℎ𝑒𝑟𝑒 𝐴𝑘→𝑓𝑒𝑎𝑡𝑢𝑟𝑒 𝑚𝑎𝑝 (Eq. 11) Secondly, following an iterative process, the method masks each feature map over the original input image by performing an element-wise multiplication between each of the upsampled and normalized feature maps and the input image. The different obtained masked images processed through the original CNN with a SoftMax output(Eq. 12), annotating the obtained score result for each feature map (Phase 2). The final map obtained is a weighted addition of the different feature maps, where the weights (Eq. 13) are given by obtained score of phase 2. The final images are processed with a ReLU activation function to eliminate any negative values (Eq. 14). This method is only interested in returning features that have a positive influence on the class of interest. A higher difference in the output score implies a larger importance of the masked region. 𝑆𝑘=𝑠𝑜𝑓𝑡𝑚𝑎𝑥(𝐹(𝑀𝑘)) 𝑤ℎ𝑒𝑟𝑒 𝑀𝑘→𝑈𝑝𝑠𝑎𝑚𝑝𝑙𝑒𝑑 𝑀𝑎𝑠𝑘𝑒𝑑 𝐼𝑚𝑎𝑔𝑒 (Eq. 12) |𝑊𝑘𝑐=𝑆𝑘 𝑐 𝑤ℎ𝑒𝑟𝑒 𝑤𝑘 𝑐→𝑊𝑒𝑖𝑔ℎ𝑡 𝑜𝑓 𝑡ℎ𝑒 𝑓𝑒𝑎𝑡𝑢𝑟𝑒𝑤 𝑚𝑎𝑝 (Eq. 13) 𝐿𝑠𝑐𝑜𝑟𝑒𝑐𝑎𝑚 𝑐=𝑅𝑒𝐿𝑈(∑𝑤𝑘 𝑐𝐴𝑘 𝑘)→𝑊𝑒𝑖𝑔ℎ𝑡 𝑜𝑓 𝑡ℎ𝑒 𝑓𝑒𝑎𝑡𝑢𝑟𝑒𝑤 𝑚𝑎𝑝 (Eq. 14) DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 52 3.8. Background generalization test The final test performed on DisplaciaNet is a background generalization test. With this test, we aim to prove that the background does not influence the scoring prediction of the model, meaning the NN is able to generalize the background artifacts. The rationale behind this method is that if the model can generalize the background, there should be no score difference between any image used to train the dataset and the same image that has had the background removed. For the test, the 56 images of the Interpretability dataset have been manually segmented to remove any artifact present in the background, obtaining an image that only contains the object of inspection, the Neutrophil, as shown in Figure 17. The artifacts located in the background, for the most part, are red blood cells, although platelets and other types of white blood cells. These new images contain the Neutrophil in the center of the image and a uniform color for the background that matches the base color of the original image’s background. Figure 17.Two Neutrophils in the same Image, with and without background (ZN_SNE_4223913.jpg) DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 53 Software Implementation This chapter overviews the Cell Annotation App design, instructions on how to be used, and instructions on how to install locally. Cell Annotation App GitHub repository [60], Cell Annotation App Docker Image [61] This chapter also overviews the general structure of the Interpretability Study Github repository [62] 4.1. Cell Annotation App An annotation application has been developed to compare the decision criteria of the DisplasiaNet NN with the expert pathologist decision criteria. This annotation application, Cell Annotation APP, is built using Dash [50], a productive web-based python framework, and packed and deployed onto an online server located at the EEBE campus of UPC for online access through the Docker platform [51]. The application aims to collect the information the pathologist considers t the most relevant o diagnose a neutrophil cell as dysplastic or normal. In section 1.4. the most relevant features between a healthy and a dysplastic neutrophil have been discussed. In unison with the pathologists at the Hospital Clinic of Barcelona, the three main features do discern whether a cell presents dysplasia or not have been selected. The following are listed in order of priority, presence/absence of granules in the cytoplasm, how densely packed the chromatin is in the nucleus, and the number of lobes the nucleus presents. Each attribute is also to be scored by the user depending on how predominant each attribute presents itself. Regarding the granularity and the chromatin state, the score ranges from zero to three, zero being not present and three being very present. For the number of lobes, a score of zero is given if the nucleus presents a standard number of lobes, between three and five, and a score of one is given for an abnormal number, hypolobulated(<3) or hyperlobulated(>5). GUI Application Description The GUI, as seen in Figure 18. Cell Annotation APP GUI, is divided into three main parts, a header(top), a visualization card (left) and, a tools card (right). The header contains the applications' title and the UPC logo, which acts as a hyperlink to the project web page. It also includes an About button that opens a pop-up window containing detailed instructions on how to use the application and valuable tips. (Annex A) DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 54 Figure 18. Cell Annotation APP GUI The Visualisation card allows the user to visualize the cell images and interact with them. On the upper region of the card, relevant information of the image can be observed. These include the path where the image is stored (File Path), the image reference name and extension(File Name), as well as the image counter (Nº), which indicates the number of images in the file directory and the current position of the image that is being visualized. The central part of the card contains the image display and fulfills two purposes. The first is to show the selected cell image, and the second is to enable the user to manually draw annotations over the image. A toolbar hoovering above the image display allows the user to configure the image visualization (zoom in, zoom out, pan, reset view) and customize the annotation tool (free draw tool, closed-loop tool, and erase selected annotation). Figure 19. Cell Annotation APP GUI - Display Card Lastly, the tools card enables the user to document the process of diagnosing dysplastic cells thoroughly. The top half of the card is dedicated to the cell diagnostic. The user can specify the cell condition (Dysplastic/Normal) as well as select the color to annotate the image. Each symptom has had a specific color assigned to it. Orange is used to annotate the absence of granules in the DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 55 cytoplasm and red for their presence. Blue is used to annotate a loosely packed chromatin in the nucleus, displayed in the image as heterogeneous staining. On the other hand, green is used to annotate a homogeneous stained nucleus. The bottom half of the tools card contains a set of buttons that enable the user to navigate the image directory. It also includes a slider to adjust the width of the annotation paintbrush. The checkboxes, Save Title and Save Annotation, save the original image with the inputted information and the drawn annotation overlaid respectively as a jpg image. Figure 20. Cell Annotation APP GUI - Tools Card The application is hosted on the DeepBox Server at the EEBE faculty as a docker container [51]. In order to access it, the user must first connect to the UPC's VPN (Virtual Private Network) UPCLink and access the server's port 8050 from the browser [53]. The images used for this study have been preloaded on the server and are accessible from the dash application. The annotated information is stored in the exact path as the images are found and can be downloaded from the server using any VNC file transfer system. Annotation procedure To annotate, the user must follow a simple workflow (Figure 21). This workflow has been designed to standardize the process and obtain consistent annotations between the different pathologist's annotations. The GUI has been designed to maximize this workflow and reduce error or confusion. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 56 First, the user must click on update images; this will refresh the images in the server directory and load the first image on the display frame. The user must then inspect the cytoplasm to decide whether it presents granules (granulated) or lacks them (transparent). Once the cytoplasm state option is selected on the tools card, the user can outline the cytoplasm with the mouse. When the user has finished outlining the cytoplasm, it will appear red if transparent was selected or orange if granulated was selected. Finally, the user must grant a score to the selected feature, zero being not predominant and three being very well represented. The user must then inspect the nucleus. First, the user must observe the nucleus and decide whether the chromatin has been stained in a homogenous matter o a heterogenic matter. Posteriorly they must outline the nucleus, the result will be a green nucleus for a homogenous stain and blue for a heterogenic stain. A score must be granted to the feature, zero being not predominant and three being very well represented. Finally, the lobes in the nucleus must be counted. The cell presents hypolobulation if there are less than three lobes(<3), and hyperlobulation if it presents more than five(>5). If it presents between three and five, it will be classified as normal. Update image path Select Chromatine state -Heterogenic - Homogenic Draw Nucleus on displayed image Select Score 0 - none 3 - max Select Nº of lobes: - Hyporlobulated - Normal - Hyperlobulated Select Cell Condition: - Dysplastic - Normal Next Image Select Cytoplasm state -Transparent - Granulated Draw Cytoplasm on displayed image Select Score 0 - none 3 - max Figure 21. User Annotation Workflow To finish the cellular exploration, the user must then diagnose the cell as Dysplastic or Normal with the help of the score information. To continue the next cell image exploration, the user can press the Next Image button located on the tools tab. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 63 Figure 24 contains the scatter plots for the Total Score vs the DisplasiaNet score; the Cytoplasm Granularity Score vs the DisplasiaNet score; and the nuclear chromatinic density score vs the DisplasiaNet score. The different classes in the plot correspond to Dysplastic cells(orange), Misclassified Dysplastic cells (Green), Normal cells (Maroon), and Misclassified Normal cells(yellow). Values above Zero for the pathologist score axis correspond to Dysplastic cells, and values below correspond to Normal cells. We can observe that the top left corner contains a cluster of Dysplastic cells. However, the distribution on the chart does not indicate a correlation between the scoring systems used in the cell annotation app and the DisplasiaNet score. For it to correlate, the pathologist score should decrease as the DisplasiaNet score increases. The same inverse behavior should apply to the cluster of normal cells located at the bottom right corner of the graphs. As for the misclassified cell images, the different clusters are located where expected, top right for misclassified dysplastic cells and bottom left for misclassified normal cells. Figure 24. Graph comparing the score from the annotation applications VS the Score obtained from DisplasiaNet. Total Score(left), Cytoplasm Score(Center), Nucleus Score(right) This direct correlation method has not furnished any insightful data regarding the classification criteria of the NN. However, the DisplasiaNet score is the final distilled classification of both the feature extraction process, performed by the convolutional section and the models, and the feature classification, performed by the dense layers. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 64 5.3. Low dimensionality projection of the Deep features The score classification by the expert pathologist can also be compared to the output of the convolutional block. This comparison can be obtained by representing the output of the convolutional block for the different images in the dataset onto a scatter plot through a twodimensional reduction of the 4,096 internal features employing the t-SNE algorithm [57] Figure 25 contains the t-SNE maps for the output last convolutional block of DisplasiaNet. The different colors indicate the different image classes studied in the dataset: Dysplastic cells (Red), Normal cells (Green), misclassified Dysplastic cells (blue), and misclassified Normal cells (cyan). The values overlaid correspond to the score obtained by means of the Cell Annotation APP. The values that have been circled in purple are the wrongly classified images that the pathologist has relabeled. As can be observed, there are two major clusters, corresponding to normal cells (upper left corner) and Dysplastic cells (center). Most of the misclassified images have been placed close to their respective clusters as expected. Interestingly enough, 5 out of the 7 misclassified images are located on the lower range of the y axis, indicating feature proximity. Figure 25. t-SNE map combined with the 4 class images and overlaid with the nominal score of the image given by the expert pathologist. As for the score correlation for the different annotated features, there is no clear pattern. An additional factor contributing to this result is the fact that pathologist evaluation criteria for granularity and chromatin density is highly subjective. There is not an exact metric to evaluate these features, which introduces great variability throughout the dataset. Nevertheless, the CNN is able to isolate enough features for the model to predict, with high accuracy, the different classes. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 65 5.4. Feature Maps In order to obtain a feature map, the original NN must be slightly modified to output information in a matter that resembles an image [28]. The first 12 Keras layers of the model are extracted and compiled to build an independent model. These layers correspond to the four convolutional blocks conformed by the convolutional, activation, and max-pooling layers. Having a total of 16 channels per layer involves obtaining a total of 192 2d feature maps. Each feature map has been normalized and represented in the Viridis color scheme to make the visualization more palatable. This color scheme assigns yellow for high values and dark blue for low values. Analyzing these maps will give us an approximate idea of what the NN has learned to detect as a relevant feature to classify a neutrophil with dysplasia or not. The selected 56 images have been visually analyzed and compared. The first layer arguably retains most of the information contained in the original image. Interestingly enough, the filters highlight the different regions of interest in the image in accordance with the neutrophils' main parts, the nucleus, the cytoplasm, and the background erythrocytes. The first activation layer filters out broad information, returning images with just the nucleus, background, or even the texture of the different regions of interest. When the activation function is applied, the filtered regions become more apparent, although a blank image is returned for some of the channels. This is due, in part, to the ReLU activation function, which truncates all negative values and only returns the positive ones. As expected, as the layers progress, more abstract features are filtered by the convolutional blocks. These advanced and more specified filters are where the differentiation between a dysplastic cell and a normal one can be observed. An example of this can be seen in the fifth channel of the third convolutional block. That particular filter searches for a granulated cytoplasm and ignores the nucleus. Figure 26 shows dysplastic cells on the left column and normal cells on the right column. Due to the agranularity presented by the dysplastic cells, the cytoplasm is hardly represented when compared to the normal cells' granulated cytoplasm. The output of the last convolutional block is complicated to analyze as the meta-features encoded within the image are highly abstract, due in significant part to the reduction in the size of the map (23x23px) compared to the original image (299x299px). DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 66 Figure 26. Difference between a Dysplastic cell and a Normal Cell - Polling layer 3- channel 5. Left (TD_BNE_2249981.jpg, TD_BNE_2256328.jpg, TD_SNE_741897.jpg ) Right (TN_SNE_118039.jpg, TN_SNE_14872661.jpg, TN_SNE_14872673.jpg ) These observations, however, are merely subjective as they are solely based on a visual representation. We do not dispose of any means to know how the NN interprets the number of lobes or qualifies the granularity level of cytoplasm in the various images. Despite that, the pieces of information the different filters focus on are in accordance with the procedures the pathologists use to diagnose dysplastic neutrophils. 5.5. Saliency maps Saliency Maps are a useful technique to highlight pixels in the input that, in the context of the NN interpretability, depict visually alluring locations for the prediction of the class image. As explained in the methodology chapter, the selected algorithm to obtain the saliency map for each image in the interpretability dataset is Smoothgrad with the parameters adjusted to : image samples N=40 and noise level σ=0.15. The complete maps can be visualized in Annex C3. Figure 27 contains the saliency maps for dysplastic images (top) and normal images (bottom) masked onto the original image. In general terms, a great emphasis is placed upon the cytoplasm for both classes. For Normal Neutrophils, the regions that present the highest saliency, those with the highest ‘heat’ correspond to areas where the granulation is high. In certain regions, the heatness of the map highlights individual highly defined granules. As for dysplastic cells, the opposite situation is highlighted; regions presenting a high saliency are those that lack granulation. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 67 Figure 27. SmoothGrad Saliency maps for Dysplastic Neutrophils (top) and Normal Neutrophils(Bottom) Regarding the Nucleus, the areas that present the highest saliency for normal cells are those that contain a high density deeply stained region. As for dysplastic cells, there is no clear pattern of highlighting the nucleus. Nonetheless, eight out of the ten dysplastic cells that present nuclear appendixes Figure 28. Are highlighted. This pattern is not observed on normal cells where only one of the nine cells that present this type of nuclear appendix is highlighted. Figure 28. Dysplastic Nuclear Aberrations Unfortunately, this visualization does not provide information regarding the number of lobes or the shape of the nucleus. Additionally, the scoring system used by the annotation application to determine the grade of granularity/agranularity of the cytoplasm as well as the heterogeneity/homogeneity of the nucleus cannot be directly correlated to the saliency output as saliency maps highlight localized regions on each of the nuclear structures and the scoring system used for the annotations evaluates the structures as a whole. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 68 5.6. Occlusion Sensitivity Techniques OSM: Occlusion Sensitivity Map The algorithm applied to the interpretability dataset has been modified from the original paper to occlude the regions with the average color of the patched region instead of with a grey patch. As can be observed, replacing the patch color with the average value of the occluded region has a significant improvement in the output. The score for the background is kept constant and equal to the benchmarked score of the image. The four analysis have been performed on each image varying the patch size: 5x5px, 10x10px,20x20px,40x40px. These output maps are interpreted the following way: The background value of the heat map matches the benchmarked score obtained for all the cells. Although the color from the background changes from one patch size to the other, for the same image, the score value is maintained constant. The heatness scale for the representation has been adjusted to the maximum and minimum scores obtained for each patch analysis. Regions marked with a higher heat, red, contribute in a positive matter to the predictions of the score. Instead lower heat or coldness, blue, contribute negatively to the prediction. Figure 29. OSM average patch 5px, 10px, 20px, 40px [TD_BNE_2249981.jpg (Top) TD_BNE_2256328.jpg (Bottom)] For dysplastic cells, the border areas of the nucleus are significant areas to determine the classification as there is a decrease in the score when occluded. Interestingly enough, when the occlusion is located anywhere inside the nucleus, there is an increase in the scoring output. This phenomenon is partly given, since the NN is lighter color region homogenous regions in the nucleus, indicating heterogenous tinction of the chromatin. This is described in section 1.4.4. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 69 Morphology of a Dysplastic Neutrophils where a characteristic of dysplastic neutrophils is the presence of clumpy heterogeneous chromatinic regions in the nucleus. Another feature worth noticing in the detection of dysplastic cells is the fact that there is no score change when the occluded region is located on the cytoplasm. This phenomenon is attributed to the lack of granules in the cytoplasm; therefore, when the average is calculated visually, the patch shows no difference to the region it is occluding. This argument is reinforced by the fact that the score slightly improves when any small remaining granule is occluded. On the other hand, OSM does not report a significant score impact for normal cells (Figure 30). The patches hardly affect the output score, as can be observed in Table 4. On average, the 40px patches, being the most aggressive occlusion, only affect the score in a ±0.5%. However, the regions where the occlusions have the largest effect are the ones covering cytoplasm granules. Meaning the presence of granules is one of the most important features for classifiying neutrophils as normal. Figure 30. OSM average patch 5px, 10px, 20px, 40px [ZN_SNE_4198926.jpg (Top) ZD_BNE_5456886.jpg (Bottom)] Table 4. contains the summary values for the OSM employing the average patch. This table has been acquired by analyzing dysplastic and normal neutrophils separately. For each image, the maximum and minimum patch scores are recorded into an array. The average score reduction is the average of the minimum patch score array. The average score increase is the average of the maximum patch score array. The maximum score reduction is the maximum score increase of all patches. The minimum score reduction is the maximum score reduction of all patches. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 70 Patch size (px2) Clas s Avg. score reduction Avg. score increase Max. score reduction Max. score increase 5 0 -0.3550% 0.3594% -2.2708% 1.6703% 10 0 -1.5539% 1.5168% -10.7401% 10.0465% 20 0 -3.9493% 2.0858% -23.3115% 11.9172% 40 0 -6.6133% 3.0333% -39.2397% 22.1266% 5 1 -0.0077% 0.0029% -0.1633% 0.0612% 10 1 -0.0492% 0.0144% -1.0655% 0.3202% 20 1 -0.1137% 0.0240% -2.3905% 0.5240% 40 1 -0.5556% 0.0312% -7.9618% 0.6764% Table 4. OSM summary table As reinforced by the previous visual analysis, the Normal-type Neutrophil prediction is not affected by the occlusion of small features. This means that the model relies upon a combination of geometries and features to diagnose a normal cell. Instead, Dysplastic type neutrophil detection is heavily influenced, firstly, by the lack of cytoplasmic granules and, secondly, by the presence of clumped chromatinic filaments in the nucleus. LIME: Local interpretable model-agnostic explanations The basic principle of this method is the same as for OSM, regions from the input image are occluded and the output score is evaluated independently for each patched region. These patches have been generated with the quick shift algorithm. The following parameters have been adjusted to: Ratio= 0.5, this parameter [0,1] balances the color-space proximity image-space proximity, higher values give more weight to the color-space proximity. Kernel_size=2 width of the gaussian kernel used in smoothing the sample density. Higher values mean fewer clusters. Max_dist=100 cut-off point for data distances. Higher values mean fewer clusters. The average number of superpixels created per image is 227.Each image is iterated 700 times with different patched occluded randomly on each iteration. The top 10 superpixels that contribute the most to the class classification are plotted for each image and masked over the original input. The result can be observed with Figure 31. The top row contains dysplastic neutrophils and the bottom row normal neutrophils. The yellow color highlights regions that contribute positively to the class prediction. On the other hand, the purple color indicates that the patch contributes negatively towards the class score. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 71 As can be observed, most of the superpixels that have a more significant effect on the prediction are located on the nucleus for both classes. This general trend is also observed in the rest of the dataset for dysplastic neutrophils (Annex C5). When analyzing the Dysplastic images, most of the superpixels that contribute positively towards the classification are yellow and are located on the nucleus. In contrast, most of the superpixels located on the cytoplasm contribute negatively to the class prediction. For the most part, this is due to the fact that those specific occluded regions contain a slight cytoplasmic granularity. As for the Normal cell images, the opposite trend is observed. The superpixels that contribute positively to the classification are located in the cytoplasm regions where the granularity is the most present. The very few superpixels that contribute negatively to the class score are located on the nucleus. Averaging the value of the cytoplasm eliminates the granules, and the lack of granules is a symptom of dysplastic neutrophils. Figure 31. Lime Results (Top: TD_BNE_2249981.jpg, TD_BNE_2256328.jpg, TD_SNE_741897.jpg,; Bottom: TN_SNE_118039.jpg, TN_SNE_14872661.jpg, TN_SNE_14872673.jpg) Nonetheless, a consideration must be taken into account when analyzing these images. Occasionally regions located nowhere close to the cell are marked as positively or negatively contributing to the class prediction. These pixels might not have any significance towards the classification and have been highlighted due to the iterative process the method is based upon. Several pixels can be active on each iteration, and each pixel is activated numerous times through the analysis. There is a chance that superpixels that do not contribute to the prediction are activated DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 72 numerous times with pixels that do. As the overall score of the iteration is evaluated, a non-realistic score might be attributed to those non-significant superpixels. This analysis has shed light on an interesting situation. Given the iteration where most of the Neutrophil is occluded, DisplaciNet is unable to locate any relevant feature and attributes a perfect score of 1, Normal cell, regardless of the class of the cell. 5.7. Class Activation Map (CAM) Techniques Grad-CAM The results obtained from the application of GradCAM to the interpretability dataset can be observed in Figure 32. For normal cells, the method has highlighted the cytoplasm as the most relevant region for 23 out of the 23 images. For dysplastic cells, 19 out of the 23 images, the nucleus has been highlighted as the most relevant region of the image. For the remaining 4 images, the method has highlighted the cytoplasm. When this information is contrasted with the pathologist annotation, these four neutrophils present mild granularity. However, this method also attributes relatively high importance to all of the background red cells. Figure 32. Grad-CAM results (Top: TD_BNE_2249981.jpg, TD_BNE_2256328.jpg, TD_SNE_741897.jpg,; Bottom: TN_SNE_118039.jpg, TN_SNE_14872661.jpg, TN_SNE_14872673.jpg) The results obtained from the application of GradCAM++ to the interpretability dataset can be observed in Figure 33. The results obtained are not satisfactory, as these should not vary too much from the simpler predecessor method. As can be observed, the highlighted regions lack sense if the DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 79 Nonetheless, interpretability of deep learning models is a complicated task. Multiple parallel analysis must be performed in order to make a strong case to defend/understand the decision criteria. The “no free lunch” theorem applies to DL interpretability meaning that one technique is not enough to shed light on all the decision criterion of the model. Instead, the overall picture is painted by comparing and contrasting the different obtained results. As future work we suggest the creation of a whiter-box model to be executed alongside DysplaciaNet. This whiter-box model, would mimic the approach the expert pathologist follows to diagnose Dysplasia in Neutrophils. Firstly, a CNN should be trained to segment the cytoplasm and the nucleus from the image. Then a trained regression model would evaluate the granularity for the cytoplasm and the chromatinic density of the nucleus. These regression outputs would be treated as a score. The addition of both scores in combination with a binary threshold would be able to diagnose the Neutrophils. The final cell diagnosis would be achieved by comparing the final classification of DisplasiaNet with the one from the Whiter-Box model. This methodology would allow to identify mismatched diagnosis as well as endowing the pathologist with contestability. The tool to create the dataset for this approach, Cell Annotation APP, is one of the contributions of this project. It allows for the creation of segmentation masks for the nucleus and the cytoplasm as well as it offers a scoring system to train the regressions. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 80 References [1] K. Hornik, "Approximation capabilities of multilayer feedforward networks.," Neural Networks, vol. 4, no. 2, pp. 251-257, 1991. [2] Zhang Z, Beck MW, Winkler DA, Huang B, Sibanda W, Goyal H, "Opening the black box of neural networks: methods for interpreting neural network models in clinical applications.," Ann Transl Med., vol. 6, no. 11, p. 216, 2018. [3] L.Malcovati and M.Cazzola , "Myelodysplastic syndromes - Coping with ineffective hematopoiesis.," New England Journal of Medicine, vol. 352, no. 6, pp. 536-538, 2005. [4] R. Shouval, J. A. Fein, B. Savani, M. Mohty, and A. Nagler, "Machine learning and artificial intelligence in haematology," British Journal of Haematology, 2020. [5] A. A. Lipes, "Deep Learning System for the Automatic Classification of Normal and Dysplastic Peripheral Blood Cells as a Support Tool for the Diagnosis (Doctoral dissertation)," Universitat de Barcelona, Barcelona, 2021. [6] B. Goodman and S. Flaxman, "European union regulations on algorithmic decision-making and a “right to explanation"," AI Magazine, vol. 38, 2017. [7] U. K. G. H. R. &. G. N. Germing, " Myelodysplastic syndromes: diagnosis, prognosis, and treatment.," Deutsches Arzteblatt international, vol. 110, no. 46, p. 783–790, 2013. [8] M. D. C. F. Ramos Ortega, "SÍNDROMES MIELODISPLÁSICOS.," in Pregrado de Hematologia, 4º edicion, Madrid, Luzán 5, 2017, pp. 318-320. [9] N. C. I. (US), "Chronic Lymphocytic Leukemia Treatment(PDQ)," in PDQ Cancer Information Summaries, Bethesda, National Institutes of Health, 2002. [10] D. A. Arber, A. Orazi, R. Hasserjian, et al., "The 2016 revision to the World Health Organization classification of myeloid neoplasms and acute leukemia," Blood, vol. 127, no. 20, p. 2391–2405, 2016. [11] J. K. P. Actor, "2 - Cells and Organs of the Immune System," in Elsevier's Integrated Review Immunology and Microbiology (Second Edition), W.B. Saunders, 2012, pp. 7-16. [12] P. Veda, "Why are neutrophils polymorphonuclear?," vol. 9, no. 2, 2011. [13] J. B. C. Niels Borregard, "Granules of the Human Neutrophilic Polymorphonuclear Leukocyte," Blood, vol. 89, no. 10, pp. 3503-3521, 1997. [14] A. Acevedo, A. Merino, S. Alferez A. Molina, L. Boldú J. Rodellar, "A dataset for microscopic peripheral blood cell images for development of automatic recognition systems," Mendeley Data, p. V1, 2020. [15] A. Maerino, "Cap. 6 Síndromes Mielodisplásicos y Neoplasias Mielodisplásicas/Mieloproliferativas," in Manual de Citología de sangre periférica y líquidos biológicos, Madrid, Panamericana, 2019, pp. 8,9. [16] Acevedo, A, Merino, A, Boldú, L, Molina, A, Alférez, S, and Rodellar, J., "A new convolutional neural network predictive model for the automatic recognition of hypogranulated neutrophilsin myelodysplastic syndromes.," Computers in Biology and Medicine, vol. 134, no. 104479, 2021. [17] T. Sejnowski, "The unreasonable effectiveness of deep learning in artificial intelligence.," Proceedings of the National Academy of Sciences, vol. 117, no. 48, pp. 30033-30038, 2020. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 81 [18] Zachary C. Lipton, "The Mythos of Model Interpretability," Communications of the ACM, vol. 61, no. 10, pp. 36-43, October 2018. [19] P. T. A. L. a. K. T. Yu Zhang, "A Survey on Neural Network Interpretability," arXiv, no. 2012.14261v3, 2021. [20] R. Roscher, B. Bohn, M. F. Duarte and Jochen Garcke, "Explainable Machine Learning for Scientific Insights and Discoveries," IEEE Access, vol. 1, no. 1, 2020. [21] A. B. Arrieta, N Díaz-Rodríguez, J. Del Ser, A. Benneot, S.tabik, A. Barbado, S.Garciía, S. Gil-Lopez, D. Molina, R. Benjamins et al., "Explainable Artificial intelligence(xai): Concepts, Taxonomies, opportunities and challenges towards responsible AI.," Information Fusion, vol. 58, 2020. [22] F. -L. Fan, J. Xiong, M. Li and G. Wang, "On Interpretability of Artificial Neural Networks: A Survey.," IEEE Transactions on Radiation and Plasma Medical Sciences, 2021. [23] F. Doshi-Velez and B. Kim, "Towards a Rigorous Science of Interpretable Machine Learning," arXiv, no. 1702.08608v2, 2017. [24] A. Nguyen, J. Yosinski, and J. Clune, "Deep neural networks are easily fooled: High confidence predictions for unrecognizable images," Proceedings of the IEEE Conference on Computer Vision and Patters Recognition, pp. 427-436, 2015. [25] Center for Devices and Radiological Health, Center for Biologics Evaluation and Research, Center for Drug Evaluation and Research, "Clinical Decision Support Software," Food and Drug Administration, 2019. [26] European Parliament, Council of the European Union, "Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC," Official Journal of the European Union, 2016. [27] L. Breiman, J.hH. Friedman, R.A. Olshen, C.. Stone, Classification And Regression Trees, Boca Raton: Routledge, 1984. [28] N. Altman, "An Introduction to kernel and nearest-neighbor nonparametric regression," The American Statistician, vol. 46, no. 3, pp. 175-185, 1992. [29] C. Sammut, G.I. Webb, Encyclopedia of Machine Learning., Boston: Springer, 2011. [30] F. Chollet, "Visualizing what covnets learn," in Deep Learning with Python, Shelter Island, Manning, 2018, pp. 160-177. [31] D. Bau, B. Zhou, A. Khosla, A. Oliva and A. Torralba, "Network Dissection: Quantifiying interpretability of deep visual representations," CVPR, 2017. [32] Y. Li, j. Yosinski, J.clune, H,Lipson and J.E. Hopcroft, "Convergent Learning: Do different Neural Networks learn the same representations?," ICLR, 2016. [33] B. Zhou, A. Khosla, A.Lapedriza, A. Oliva, Aude and A. Torralba, "Object detectors emerge in Deep Scene CNNs," ArXiv: Computer Vision and Pattern Recognition, 2014. [34] M. D. Zeiler and R. Fergus, "Visualizing and understanding convolutional networks," in Computer Vision-ECCV 2014, Springer, 2014, p. 818–833. [35] B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba, "Learning deep features for discriminative localization.," Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2921- 2929, 2016. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 82 [36] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra, "Grad-cam: Visual explanations rom deep networks via gradient-based localization.," Proceedings of the IEEE International Conference on Computer Vision, pp. 618-626, 2017. [37] A. Chattopadhay, A. Sarkar, P. Howlader, and V. N. Balasubramanian, "Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks," Procedings of the IEEE Winter Conference on Applications of Computer Vision, pp. 839-847, 2018. [38] H. Wang, Z. Wang, M. Du, F. Yang, Z. Zhang, S. Ding, P. Mardziel, X. Hu, "Score-CAM: Improved Visual Explanations Via Score-Weighted Class Activation Mapping," arXiv: Computer Vision; Machine Learning, no. arXiv:1910.01279v1, 2019. [39] A. Bansal, A. Farhadi and D. Parikh, "Towards transparent systems: Semantic characterization of failure models.," ECCV, 2014. [40] Y. Wang, H. Su, b. Zhang and X. hu, "Interpret Neural Networks by identifiying critical data routing paths," CVPR, 2018. [41] K. Simonyan, A. Vedaldi and A. Zisserman, "Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps," arXiv : Computer Vision and Pattern Recognition, no. arXiv:1312.6034v2, 2014. [42] D. Smilkov, N. Thorat, B. Kim, F. Viégas and M. Wattenberg, "SmoothGrad: removing noise by adding noise," arXiv: Machine Learning; Computer Vision and Pattern Recognition, no. arXiv:1706.03825, 2017. [43] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin, "Why should I trust you?: Explaining the predictions of any classifier.," In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, p. 11351144, 2016. [44] Scott M Lundberg and Su-In Lee, "A Unified Approach to Interpreting Model Predictions," in 31st Conference on Neural Information Processing Systems (NIPS 2017, Long Beach, CA, USA, 2017. [45] l. Shapley, "A value for n-person games," Contributions to the theory of games. Princeton University Press, pp. 307-317, 1953. [46] P. Van Molle, M de Strooper, T. Verbelen, B. Vankeirsblick, P. Simoens and B. Dhoedt, "Visualizing convolutional neural networks to improve desicion support for skin lession classification," Understanding and Interpreting Machine Learning in Medical Image computing Applications, pp. 115-123, 2018. [47] A. R. J. E. S. W. A. N. J. C. U. E. B. L. C. a. G. D. A. Zaritsky, "Interpretable deep learning uncovers cellular properties in label-free live cell images that are predictive of highly metastatic melanoma,," Cell Systems, vol. 12, no. 7, pp. 733-747. e6, 2021. [48] J.R. Zech, M.A. Bagdeley, M. Liu, A.B. CostaJ.J. Titanoand E.K. Oerman, "Variable generalisation performaceof a deep learning model to detect pneumonia in chest radiographs: A cross sectional study," PLooS Medicine, vol. 15, no. 11, 2018. [49] A. A. Cruz-Roa, J. E. Arevalo Ovalle, A. Madabhushi, F. A. González Osorio, "A Deep Learning Architecture for Image Representation, Visual Interpretability and Automated Basal-Cell Carcinoma Cancer Detection," in Medical Image Computing and Computer-Assisted Intervention -- MICCAI 2013, Berlin, Springer Berlin Heidelberg, 2013, pp. 403-410. [50] S. Pereira, R.Meier, R. McKinley, R. Wiest, V. Alves C.A. Silva and M.Reyes, "Enhancing intepretability of automatically extracted machine learning features: application to a RBM- Random forest systems on a brainlesion segmentation.," Medical Image Analysis, vol. 44, pp. 228-244, 2018. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 83 [51] J. W. J. C. W. e. a. Diao, "Human-interpretable image features derived from densely mapped cancer pathology slides predict diverse molecular phenotypes," Nature Communications, vol. 12, no. 1613, 2021. [52] Plotly, "Plotly Dash Documentation," [Online]. Available: https://dash.plotly.com/. [Accessed 20 04 2021]. [53] Docker, "Docker Documentation," [Online]. Available: https://docs.docker.com/. [Accessed 23 04 2021]. [54] L. van der Maaten and G. Hinton, "Visualizing Data using t-SNE," Journal of Machine Learning Research, vol. 9, pp. 2579-2605, 2008. [55] L. v. d. Maaten, "Learning a Parametric Embedding by Preserving Local Structure," Proceedings of the Twelth International Conference on Artificial Intelligence and Statistics, vol. 5, pp. 384-391, 2009. [56] A. Shrikumar, P Greenside, and A. Kundaje, "Learning important features through propagating activation differences.," Proceedings of the 34th International Conference on Machine Learning, vol. 70, 2017. [57] Z. Zhong, L. Zheng, G. Kang, S. Li and Y. Yang , "andom Erasing Data Augmentation.," Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, no. 07, pp. 13001-13008, 2020. [58] S. Yun, D. Han, S. Joon Oh, S. Chun, J. Choe, Y. Yoo, "CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features," ArXiv: Computer Vision and Pattern Recognition, 2019. [59] A. Vedaldi,S. Soatto, "Quick shift and kernel methods for mode seeking," European Conference on Computer Vision - ECCV 2008, pp. 705-718, 2008. [60] S. Hernandez, "Github Repository - Cell Annotation APP," [Online]. Available: https://github.com/Stevecreations/Cell_Annotation_TFM. [Accessed 2021 07 02]. [61] S. Hernandez, "Docker Repository - Cell Annotation APP," [Online]. Available: https://hub.docker.com/repository/docker/stevecreations/tfm_cell_annotation_app/. [Accessed 2021 07 02]. [62] S. Hernandez, "DysplaciaNet Github repository," [Online]. Available: https://github.com/Stevecreations/DysplaciaNet_Interpretability_Study. [63] S. Hernandez, "Cell Annotation App," UPC, [Online]. Available: http://deepbox.eebe.upc.edu:8050/. [Accessed 2021 06 29]. [64] "Docker desktop suite," Docker INC., [Online]. Available: https://www.docker.com/products/dockerdesktop. [Accessed 22 09 2021]. [65] werdlow SH, Campo E, Harris NL, Jaffe ES, Pileri SA, Stein H, Thiele J, WHO vClassification of Tumours of Haematopoietic and Lymphoid Tissues, 4th ed, International Agency for Research on Cancer, 2017. [66] M.D. Zeiler and R. Fergus, "Visualizing and understanding convolutional Networks.," ECCV, pp. 818- 833, 2014. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 84 Annex A. Cell Annotation Application Instructions The following Annex contains the detailed intructions of the Cell Annotation Application. These are visisble to the user when the About button, present in the header, is presed. App description Cell Dysplasia Annotation App enables the user to annotate microscopic images of blood cells. There are three main indicators pathologists use to detect whether a cell is dysplasic or not. These are: a) Check for absence of granularity in the cell's cytoplasm. A healthy cell presents a certain granularity in the cytoplasm. b) Check for Hyperchromasia. A dysplastic cell will display an increased chromatin content resulting in a deeply stained nucleus. c) Number of lobes of cell nuclei. A healthy cell usually presents between 2 and 5 lobes. Other factors to bear in mind are: d) Ratio between the nuclei and the cytoplasm as Dysplastic cells present a larger nucleus than healthy ones e) An increase of the Miotic figures. A. 1 [ healthy_vs_displastic_cell](/assets/images/healthy_vs_displastic.jpg) This app allows the user to annotate and classify areas in an image. • Navigate the images in directory • Freehand draw, using the mouse to highlight specific areas of the image. • Select annotation type Cytoplasm(Granular / Transparent), Chromatin (Heterogenic / Homogenic), Nº of Lobes (Hyposegmented/ Normal / Hypersegmented) • Select the priority of each characteristic when deciding if a cell is Healthy or presents Dysplacia. • Export the annotations made as a txt file (json format) and as an image. How to use this app DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 85 The first step is to update the path directoryehre the images are stores by clicking on `Update Image Path`. To annotate the image, first select the annotation label you want to apply: A. 2[Screenshot of label selector](/assets/images/select_label.jpg) Then highlight the desired image area to annotate with the cursor: A. 3![Screenshot of annotation](/assets/images/draw_annotation.jpg) The width of the annotation brush can be changed with the slider bar `Width of annotation paintbrush` . A. 4![Screenshot of width_paintbrush](/assets/images/width_paintbrush.jpg) Additional annotations can be made by selecting a new label and highlighting the regions on the image. A. 5![Screenshot of_additional_annotation](/assets/images/additional_annotation.jpg) DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 86 In order to classify the images correctly, it is important to select the decision criteria priority by clicking on the radio butons `priority - 0(null) / 1(min) / 2 / 3(max)` The user can also state if a cell is dysplactic or healthy by the redio button `Cell condition` A. 6 ![Screenshot of_Cell_condition](/assets/images/cell_condition.jpg) To select a different image the press on the `previous` and `next`. The current annotations made on the image will be stored in a txt file in the same directory as the image source. An image with the annotations will also be stored will aso be stored. A. 7 ![Screenshot of_Navigation](/assets/images/navigation.jpg) To download an image with the annotations and/or info entered press on the check boxes `Save annotation` `Save_title` respectively. The image below is an example of when both annotation and title are saved. A. 8 ![Screenshot of_Save_title_Annotation](/assets/images/save_title_annotation.jpg) To erase an already made annotation click of the desired annotation and then hit the errase button on the top of the image editor. DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 87 A. 9 ![Erase_annotation](/assets/images/errase_annotation.jpg) Annotations can also be adjusted by draging the black circunferences of the border of the annotation to the desired location. Credits S. Hernandez - 2021 Universitat Politecnica de Catalunya in collaboration with Hospital Clinic de Barcelona DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 88 Annex B. Annotation Data + DisplasiaNet prediction Image Name Dataset Class DisplasiaNet Cytoplasm Chromatin Lobe Total score Pathologist Diagnosis Score Prediction State Score State Score State Score TD_BNE_2249981 0 0.0334 0 Transparent 3 Hetero 3 Hyposegmented 1 7 DYSPLASTIC TD_BNE_2256328 0 0.0463 0 Transparent 3 Hetero 2 Hyposegmented 1 6 DYSPLASTIC TD_SNE_741897 0 0.0009 0 Transparent 3 Hetero 2 Normal 0 5 DYSPLASTIC ZD_BNE_2433069 0 0.3919 0 Transparent 1 Hetero 2 Hyposegmented 1 4 DYSPLASTIC ZD_BNE_2433092 0 0.0013 0 Transparent 3 Hetero 1 Hyposegmented 1 5 DYSPLASTIC ZD_BNE_2433255 0 0.2043 0 Transparent 2 Hetero 3 Hyposegmented 1 6 DYSPLASTIC ZD_BNE_2433280 0 0.0017 0 Granulated -1 Hetero 3 Hyposegmented 1 3 DYSPLASTIC ZD_BNE_2759813 0 0.0002 0 Transparent 3 Hetero 3 Normal 1 7 DYSPLASTIC ZD_SNE_2433225 0 0.1755 0 Transparent 3 Hetero -1 Hyposegmented 1 3 DYSPLASTIC ZD_SNE_2543049 0 0.0619 0 Transparent 1 Hetero 1 Hyposegmented 1 3 DYSPLASTIC ZD_SNE_2543060 0 0.0001 0 Transparent 3 Hetero 2 Normal 0 5 DYSPLASTIC ZD_SNE_2543086 0 1.0E- 07 0 Transparent 2 Hetero 2 Hyposegmented 1 5 DYSPLASTIC ZD_SNE_2759718 0 0.0490 0 Transparent 2 Hetero 2 Hyposegmented 1 5 DYSPLASTIC ZD_SNE_2759795 0 0.0037 0 Transparent 3 Hetero 2 Hyposegmented 1 6 DYSPLASTIC ZD_SNE_6643852 0 4.6E- 05 0 Transparent 3 Hetero 3 Normal 0 6 DYSPLASTIC ZD_SNE_6643874 0 2.5E- 06 0 Transparent 3 Hetero 2 Hyposegmented 1 6 DYSPLASTIC ZD_SNE_6643949 0 0.0007 0 Transparent 3 Hetero 3 Hypersegmented 1 7 DYSPLASTIC ZD_SNE_6700392 0 2.3E- 06 0 Transparent 3 Hetero 3 Hypersegmented 1 7 DYSPLASTIC ZD_SNE_6700394 0 2.2E- 05 0 Transparent 3 Hetero 3 Normal 0 6 DYSPLASTIC ZD_SNE_6700404 0 1.5E- 06 0 Transparent 3 Hetero 3 Hypersegmented 1 7 DYSPLASTIC ZD_SNE_6700428 0 4.3E- 05 0 Transparent 3 Homo. -1 Normal 0 2 DYSPLASTIC ZD_SNE_6700434 0 0.0001 0 Transparent 3 Homo. 3 Normal 0 6 DYSPLASTIC ZD_SNE_6700475 0 1.5E- 05 0 Transparent 3 Homo. 3 Normal 0 6 DYSPLASTIC Image Name Dataset Class DisplasiaNet Cytoplasm Chromatin Lobe Total score Pathologist Diagnosis Score Prediction State Score State Score State Score WD_BNE_2426191 0 0.9889 1 Transparent 3 Heterogenic 3 Hyposegmented 1 7 DYSPLASTIC WD_SNE_2426196 0 0.9997 1 Transparent 1 Heterogenic 1 Hyposegmented 1 3 DYSPLASTIC WD_SNE_2683958 0 1.0000 1 Transparent 2 Heterogenic 3 Hyposegmented 1 6 DYSPLASTIC WD_SNE_2288170 0 1.0000 1 Granulated -1 Homogenic -3 Hipersegmented 1 -3 NORMAL WD_SNE_2426212 0 1.0000 1 Granulated -1 Heterogenic 1 Normal 0 0 NORMAL DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 95 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 96 C4. Occlusion sensitivity Maps DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 97 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 98 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 99 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 100 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 101 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 102 C5. LIME DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 103 C6. Grad-CAM Maps DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 104 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 111 Normal Neutrophils Image Class Original Score Masked Score Difference TN_SNE_118039 2.0000 1.0000 0.9943 0.0057 TN_SNE_14872661 2.0000 0.9999 0.9979 0.0020 TN_SNE_14872673 2.0000 1.0000 0.9975 0.0024 ZN_SNE_4198926 2.0000 1.0000 1.0000 0.0000 ZN_SNE_4198932 2.0000 1.0000 1.0000 0.0000 ZN_SNE_4198946 2.0000 1.0000 1.0000 0.0000 ZN_SNE_4198957 2.0000 1.0000 1.0000 0.0000 ZN_SNE_4198961 2.0000 1.0000 1.0000 0.0000 ZN_SNE_4198990 2.0000 1.0000 1.0000 0.0000 ZN_SNE_4199013 2.0000 1.0000 1.0000 0.0000 ZN_SNE_4199046 2.0000 1.0000 1.0000 0.0000 ZN_SNE_4223869 2.0000 1.0000 1.0000 0.0000 ZN_SNE_4223913 2.0000 0.9916 0.9998 -0.0082 ZN_SNE_5456732 2.0000 1.0000 1.0000 0.0000 ZN_SNE_5456876 2.0000 1.0000 1.0000 0.0000 ZN_SNE_5456885 2.0000 1.0000 1.0000 0.0000 ZN_SNE_5456900 2.0000 0.9998 1.0000 -0.0002 ZN_SNE_5456910 2.0000 1.0000 1.0000 0.0000 ZN_SNE_5456916 2.0000 1.0000 1.0000 0.0000 ZN_SNE_5456924 2.0000 1.0000 1.0000 0.0000 ZN_SNE_5456933 2.0000 0.9998 0.9999 -0.0001 ZN_SNE_5456968 2.0000 1.0000 1.0000 0.0000 ZN_SNE_5456971 2.0000 1.0000 1.0000 0.0000 Misclassified Normal Neutrophils Image Class Original Score Masked Score Difference WN_BNE_3328133 4.0000 0.0126 0.5017 -0.4891 WN_SNE_3328147 4.0000 0.0541 0.5017 -0.4476 WN_SNE_5500961 4.0000 0.5496 0.8147 -0.2651 WN_SNE_5500993 4.0000 0.0014 0.3207 -0.3193 WN_SNE_5501052 4.0000 0.0001 0.2980 -0.2980 DEEP LEARNING INTERPRETABILITY METHODS FOR THE CLASSIFICATION OF BLOOD CELLS 112