Flow XAI mimics human immunophenotyping specialists
Flow XAI closely resembles the human diagnostic approach. Determining the quality of sample data is always the first step, as it is important in any diagnostic report, with the second step being sample diagnosis. Hence, Flow XAI consists of two major algorithmic parts (see supplementary A for methodological details). First, the unsupervised TileMining (TM) algorithm19 is used to identify typical cases in the data and leads to a subsequent identification or even elimination of uncharacteristic data cases; second, a supervised Flow XAI module that learns typical cases emulates a committee of AI experts. The performance of each AI expert committee member is based on the algorithmic population description (ALPODS) algorithm20-22. Diagnostic decisions in the system follow a five-level decision tree that was originally learned from the data and subsequently verified by the physicians, see Fig. 1. The TM algorithm realizes quality control at decision tree level zero (L0). In level L1, samples from presumed healthy individuals/normal controls (NCs) are distinguished from those from B-NHL patients. Correct classification of NC cases is of particular importance because a false positive diagnosis of lymphoma “cancer” fundamentally affects treatment decisions.
Once B-NHL has been verified, Flow XAI is challenged at the second diagnostic level (L2) to distinguish chronic lymphocytic leukemia (CLL), CLL-like diagnoses of prolymphocytic leukemia (PL), monoclonal B-cell lymphocytosis (MBL) and HCL from all other lymphomas (AOL). Immunophenotyping experts prioritize the correct classification of these lymphoma entities because a biopsy with histopathological confirmation is not needed to diagnose CLL [NCCN Guidelines Version 3.2023]. For the diagnosis of HCL, immunophenotyping is an essential diagnostic requirement [NCCN Guidelines Version 1.2023].
Notably, the nomenclature and categories of the tree level three (L3) lymphoma category definitions have progressively shifted due to the growing knowledge of molecular genetic aberrations and pathways23,24. To align our analysis with previous studies7,18, we investigated the most common and distinct mature lymphoma types in the L3 AOL subcategory: mantle cell lymphoma (MCL), marginal zone lymphoma (MZL), lymphoplasmacytic lymphoma (LPL), and follicular lymphoma (FL). Rare B-NHL or large cell lymphomas were classified into one category as L3 B-NHL and not considered for further classification. Progression or transformation into large cell lymphomas or leukemia occurs on a continuum, thereby making specific classifications even more difficult. Importantly, the term B prolymphocytic leukemia was eliminated in WHO-HAEMS5, and a PL subclass is now designated as the prolymphocytic progression of CLL23.
In sum, Flow XAI was designed to give advice when diagnostic decisions are to be made in a way analogous to the process used by medical experts.
The general performance of Flow XAI at the diagnostic levels
The performance of Flow XAI was evaluated on peripheral blood samples from a published dataset from the Munich Leukemia Laboratory (MLL9F) using 19,493 peripheral blood cases7. The total number of patients in the malignant lymphoma categories (L2 and L3) ranged from 202 (HCL) to 4,274 (CLL) with highly unbalanced class sizes in all categories: B-NHL 45.3%; NCs 54.7%; CLL-like (CLL&MBL&PL) 33.5%; HCL 1%; AOL 11.8%; CLL 22.9%; MBL 7.8%; PL 2.8%; MCL 1.5%; MZL 5.3%; LPL 3.5%; FL 1.2% and HCLv 0.3%. The performance of Flow XAI without TM was evaluated on the entire dataset, where N=100 denotes the number of randomly performed class-balanced data splits, i.e., 80% training data (15,594 test cases) and 20% test data (3,899 test cases). Flow XAI is capable of differentiating NC (N=2,133) from B-NHL (N = 1,766) with an average accuracy of 94.2 ± 0.4% in L1. With the imbalanced class sizes, the Matthews correlation coefficient (MCC) was chosen to assess the L2 and L3 performance of the algorithms}. The MCC is designed to handle class imbalance 25 and is considered more reliable than the F1 measure26. Flow XAI classifies CLL and CLL-like cases, HCL cases, and other malignant lymphomas against NC cases, with an average MCC of 85.4 ± 0.7% in L2. The corresponding classes learned by Flow XAI are summarized in Supplementary Information A, Supplementary Table 1. For the AOL categories MCL, MZL, LPL, and FL, Flow XAI performed immunophenotyping, with an average MCC of 81.8 ± 0.7% in L3. The cross-validation results are illustrated in Fig. 2a as a mirrored-density plot (MD plot) to highlight the probability density function (pdf) and simultaneously visualize the distribution27. The MD-plot visualization confirms that there is no multimodality within the values of the quality measures, indicating that the split between the test set and training set, i.e., subsampling of cases, is homogeneous. Furthermore, the MD plot indicates the normality of a distribution by overlaying the pdf with a robustly estimated Gaussian distribution (magenta line).
Next, we incorporated the Flow XAI system’s self-assessment capability as the trustworthiness for each diagnosis. The numeric values of trustworthiness were subsequently categorized into three degrees: confident, probable, and challenging, in alignment with human assessment groupings28. To address the average performance of Flow XAI when trustworthiness is considered, the MCC, accuracy (ACC), false positive rate (FPR), and false negative rate (FNR) were calculated for decisions on L3 data. The comparison is illustrated in Fig. 2b.
For 100 cross-validation trials per degree of trustworthiness, Flow XAI categorizes 7-12% of test cases as challenging, 20-35% as probable, and 52-73% as confident (5th to 95th percentile, Fig 2c). Interestingly, the distributions of the number of test cases per degrees of trustworthiness are bimodal in Fig. 2c. A detailed look reveals 16 cross-validation cycles with less than 8% of the patients in the challenging and probable degree of trustworthiness and more corresponding classifications as confident. This heterogeneous pattern of the cross-validation results underscores the necessity of conducting at least 100 cross-validation trials because the results may appear superior (or inferior) by chance.
The MCC of the samples in the confident degree of trustworthiness ranged from 88% to 91%, with a median of 90% (MCC). The performance of the probable degree stayed in the range of 70-80%, with a median of 77%, and the challenging degree had a large variance in performance, with a range between 47% and 68% (median 60%) as illustrated in Fig. 2d. The performance in the confident degree of trustworthiness follows a Gaussian distribution (magenta frame), while the other degrees appear less homogenous. This could be attributed to the high number of samples in the confident degree.
The average FlowXAI performance, which comprises all probable and confident degrees of trustworthiness for all cross-validation steps, is 85.1% (MCC), displayed as a red horizontal line with a dot in Fig. 2e. Of note, this performance was achieved for N=3,488 (89%) samples, as indicated by the red vertical line. Using a large number of test samples from a nonrandomized test set with imbalanced class sizes and a high number of cross-validation trials prevents the underestimation of errors29,30. For a direct comparison, the performance of the deep learning AI system7 is depicted as a purple dot (83%) in Fig. 2e. The deep learning AI was trained on the same dataset with one cross-validation test7. The number of test cases for each AI strategy is indicated on the y-axis.
Finally, the Flow XAI performance was determined after TM's elimination of atypical samples, which estimates the data density structures from all bivariate combinations of markers and learns the pattern distribution in an unsupervised manner. When atypical cases are discarded, the ACC and MCC improve slightly but not markedly for all trustworthiness degrees (Fig. 2f). False negative rates predominantly declined in the challenging degree of trustworthiness. Contingency tables were computed for each cross-validation trial to reveal the detailed performance results for every malignant lymphoma entity (Supplementary Information B, Supplementary Tables 2-5).
Thus, by modeling the stepwise manual diagnostic approach (Fig. 1), Flow XAI is capable of discriminating B-NHL patients with high accuracy and self-assessed competence, as needed for trustworthy diagnostic reports.
Explaining Flow XAI diagnoses decision
Flow XAI justifies its diagnostic decisions by providing individual explanations specifically tailored to physicians31. For example, the diagnosis of HCL is considered positive if human experts find “hairy cells”, which exist in a tiny but distinct B-cell population with a unique antigen expression pattern characterized as CD103+++, CD25+++, CD19++, CD25++, or SS++. For the confident trustworthiness degree, on average, all HCL cases were classified correctly, as depicted in Supplementary Information B, Supplementary Table 3. The false-positive (N=4) and false-negative HCL (N=4) cases were, on average, assigned to the probable degree of trustworthiness (Supplementary Information B, Supplementary Table 2). Flow XAI learned and subsequently used four particular cell populations to classify the cases as HCL. The decision depended solely on tube 2, containing the relevant HCL antibodies. These four populations, considered to be highly relevant to Flow XAI’s diagnostic decision-making, are highlighted in the left column (Fig. 3). In the first row, an NC case (named a true negative) is depicted; the B-cells show a typical light chain distribution pattern for kappa and lambda, and the “hairy cell gate” (CD103 vs. CD11c) is almost empty (Fig. 3a). In the second row, HCL was incorrectly suspected because ALPODS revealed populations in the B-cell or hairy cell regions (Fig. 3b). A human expert can recognize that CD19+ cells do not appear as lymphocytes in CD45+ vs. SS images and “understands” that Flow XAI’s reasoning is incorrect. Sample degradation could be a biological reason for granulocytes' presumably unselective antibody capture. A real HCL case is depicted as a “true positive” in the third row (Fig. 3c), which illustrates that the hairy cells correspond to “highly scattered lymphocytes” in the CD45 vs. SS image and are indeed CD103++CD11c+++, i.e., they highly express these epitopes. Additionally, as depicted in the right column, the correctly classified hairy cells exhibited light chain restrictions, i.e., a significant predominance of kappa vs. lambda light chains. CD25 and other B-cell epitope expression patterns are not shown to simplify the graphic.
Finally, a false negative sample was chosen for further illustration (Fig. 3d). Although the algorithm correctly recognized that the events in the hairy cell region were not B cells, the subtle population masked by the irregular staining pattern of a dominant granulocytic fraction was not detected. Of note, there were fewer than 700 relevant events in each population. Dot plot images for the remaining six incorrectly classified HCL cases are provided in Supplementary Information C, Supplementary Figs. 2-3.
In summary, Flow XAI selects and reports diagnostically relevant cell populations and expression patterns in a human-understandable and clear manner; thus, immunophenotyping experts can make decisions with confidence.
Reducing the number of training cases via TileMining (TM)
With respect to high case variances, conventional subsymbolic machine learning AI approaches for classification require a large amount of training data to achieve good generalization performance. However, a low amount of training data, particularly for less frequent lymphoma entities, limits the applicability of such systems in small- or medium-sized diagnostic laboratories. Therefore, we incorporated the TM method (see supplementary A for details) with respect to quality control at diagnostic level zero (L0). Another advantage of TM is that it identifies typical cases, representing the core structures of the data by performing a rough density estimation on all bivariate combinations of markers. By the central limit theorem32, the sum of these densities (called strangeness S) follows a Gaussian normal distribution. For the N=19,493 samples from the MLL9F dataset, S ranges from -30 to 200 and can be modeled as a Gaussian distribution within each tube. The definition of a set of thresholds t1 and t2 for p(S < t1) < 1% and p(S > t2) < 1% results in 19% (N=3710) of N = 19,493 samples, respectively. Samples exceeding the thresholds in at least one tube were classified as atypical and, therefore, discarded from the training set in this and the next sections. The entire Flow XAI workflow is illustrated in Fig. 4a.
For TM validation, a set of 100 randomly drawn atypical cases was reviewed by immunophenotyping experts. The manual analysis of the bivariate plots confirmed that 96 TM-selected data samples were indeed judged as altered or hardly evaluable by the human experts; i.e., they would not pass the quality control of L0. Only 4% of the atypical samples were considered usable for a trustworthy manual diagnostic workflow across all tubes as the base for a valid diagnostic report (Supplementary Information D, Supplementary Fig. 4). The presumed reasons for the strong alterations were incomplete erythrocyte lysis, irregular antibody staining patterns or other aberrations, most likely acquisition artifacts. In addition to obvious aberrations or clear outliers, biological variance exists for all lymphoma categories, a problem that can be addressed by manual scoring systems4.
Furthermore, the performance of our TM-integrated Flow XAI algorithm on L1 data, i.e., its ability to separate NC samples from B-NHL samples was assessed via a second independent benchmark algorithm, the cluster identification, characterization, and regression algorithm (CITRUS)1.
Five hundred and twelve samples were randomly selected for training, with 256 NC samples and 256 B-NHL samples equally distributed for diagnoses (in the MLL9F dataset specified in Supplementary Information B, Supplementary Table 1) were randomly drawn 100 times. The samples were either drawn randomly or restricted to the category of typical samples as defined by TM. For simplicity, both AI systems CITRUS and Flow XAI, as the committee of ALPODS experts, were restricted in this experimenttoasingle tube. Flow XAI combined with TM-sample-selection outperforms the CITRUS algorithm in L1 (basic CITRUS). Fig. 4b shows the accuracies of the pdfs based on 96.7% (n=15,271) of the test cases in the MD plots. The L1 performance of TM-CITRUS was computed to test whether TM selection of typical training cases improves the CITRUS algorithms' usage. The median accuracies for the CITRUS, TM-Flow XAI, and TM-CITRUS models were, on average, 82%, 90%, and 89%, respectively, although it should be noted that all three distributions were skewed and not normally distributed. The accuracies were significantly different to each other (unpaired two-sided Wilcoxon rank sum tests with continuity correction with the alternative hypothesis being that the true location shift is not equal to zero, , and p ). The highest performance can be achieved with Flow XAI, and the selection of typical training cases by TM improves the usage of CITRUS.
When Flow XAI is combined with TM, only 256 B-NHL samples equally distributed across all diagnoses are sufficient to learn the further diagnostic levels. Despite the small training set, Flow XAI was able to classify 49% of the samples as confident, 30% of the samples as probable, and 21% of the samples as challenging (Fig. 4c). For the N=7,684L3 samples predicted by Flow XAI in the confident class, an MCC of 87% was reached (Fig. 4d). The corresponding contingency tables present the details of the diagnostic performance (Supplementary Information B, Supplementary Tables 6-8). Flow XAI combined with TM outperforms the deep learning AI system in regard to the automated diagnosis of six different lymphoma groups in terms of the confident class, where the MCC values were 87% and 83%, respectively, although only 256 instead of 18,274 cases were used for AI training. In supplementary information E, we sought to assess the performance of Flow XAI when the data structure does not allow for TM-based prototype selection. The performance reaches 80% in the confident degree of trustworthiness, as shown in Supplementary Information E, Supplementary Fig. 5.
Validation of the flow cytometric XAI performance on a second independent dataset
We used a second dataset containing 638 samples from the diagnostic center Marburg (PUM2) to confirm that Flow XAI can be applied to any given B-NHL immunophenotyping dataset. The immunophenotyping diagnostic laboratory uses a panel with different B-cell epitopes measured in two tubes-per-patient samples, as described previously4. First, TM was employed to discriminate typical and atypical cases, as described above. A total of 121 samples were considered atypical (the results are presented inSupplementary Information F, Supplementary Fig. 6). For the PUM2 dataset, 100 trials of cross-validation were performed on 317 typical L1 cases. For each trial, the training data consisted of 100 NC and 100 B-NHL samples (30 CLL, 15 MCL, 10 FL, 10 MZL, 5LPL, 10 HCL, 10 MBL, and 10 NS, as shown in Supplementary A, Table 1).
Even with this small dataset, Flow XAI classified 57% of patients as confident, 31% as probable, and 12% as challenging (Fig. 5a). The accuracy of the performance measures was chosen due to the balanced group sizes. The accuracy was 99% when Flow XAI was confident, 89% when XAI estimated that the appropriate diagnosis was probable, and 69% when XAI judged a sample as challenging (Fig. 5b). The variance in the confident degree of trustworthiness is very low, while the challenging degree exhibits a high variance, as shown in the MD plot. Interestingly, none of the estimated PDFs exhibited a Gaussian distribution (magenta frame), presumably indicating that the learning of the structures in the data can be improved with a larger number of cases.
Thus, we demonstrated that Flow XAI can distinguish B-NHL patients with an independent differentially designed diagnostic lymphoma immunophenotyping panel and is capable of reporting confident results in the discrimination of B-NHL patients from healthy individuals, with an accuracy of 99% in more than 50% of patients with only 200 total training data samples. The FlowXAI system was deployed within a web-framework and is accessible with the Marburger data via https://plait.mathematik.uni-marburg.de/. If the user selects a case of the Marburger dataset, leave-one-out cross-validation with this case is performed within the platform.
Self-organized lymphoma classification using swarm intelligence
A particular challenge is the fact that lymphoma classification historically has been fluid. After the initial description of Hodgkin lymphoma in 1832 and Non-Hodgkin Lymphoma in 1925, various classifications coexisted until the National Lymphoma Study Group (ILSG) proposed the Revised European and American Lymphoma (R.E.A.L.) classification in 1994, which firstly considered immunopathology aspects.
In 1997 it was replaced by an international classification of the World Health Organization (WHO), with the 5th edition published in 2022. We intended to achieve an unsupervised data-based view on putative lymphoma entities there. For this, we used the data within a swarm intelligence and self-organization framework 33,34 to visualize lymphoma based on the immunophenotypic characteristics obtained from the MLL9 data set (Fig. 6). The result is presented as a three-dimensional landscape in which elevations representing data distances, are colored as in topographic maps35. Cluster or diagnostic classes of the cases are represented as colored dots on the visualization of the generalized U-Matrix34,36. The algorithm visualized two main cluster groups and outliers (Fig 6a). Interactively clustering of MLL9 panel data37,38 confirms a clear separation between NC as white dots and B-NHL as black dots in Fig. 6b. This is consistent with the decision tree levels L0 and L1 (Fig 1). Subsequently, TM was applied, and a second topographic map on the entire set of lymphoma entities now revealed three main clusters and some outliers (Fig. 6c). Figure 6d matches this clustering to the diagnoses: HCL appears as a distinct group and CLL, MBL and PL cluster together hereby confirming the appropriate choice of the diagnostic level approaches L2 and L3. Interestingly, PL and MCL clustered in the same region while MZL and LPL were separated to some extent. The corresponding lymphoma groups for each cluster are provided in Supplementary B, Table 9-10). Whether the AI categorization or the MLL9 definition is “correct” for each single case can be evaluated by a detailed look on the “XAI explanation” or the primary data files or additive histopathology or genetic information. The unbiased, unsupervised view into the complex multidimensional MLL9 data set provides novel information about immunophenotypic lymphoma groups and their spatial proximity: its clustering and resolution do not entirely match with the separation of the WHO lymphoma classification.