EVOLVED AND TRANSPARENT PIPELINES FOR
BIOMEDICAL IMAGE CLASSIFICATION

Camilo de la Torre, Giorgia Nadizar, Yuri Lavinas, Robin Schwob, Camille Franchet, Hervé Luga, Dennis Wilson, Sylvain Cussat-Blanc

<figure><img src="image_1.png" /></figure>

To cite this version:

Camilo de la Torre, Giorgia Nadizar, Yuri Lavinas, Robin Schwob, Camille Franchet, et al. EVOLVED AND TRANSPARENT PIPELINES FOR BIOMEDICAL IMAGE CLASSIFICATION. European Conference on Genetic Programming (Part of EvoStar), Apr 2025, Trieste, Italy. pp.173-189, 10.1007/978-3-031-89991-1_11. hal-05039992

HAL Id: hal-05039992

https://hal.science/hal-05039992v1

Submitted on 18 Apr 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
EVOLVED AND TRANSPARENT PIPELINES FOR BIOMEDICAL
IMAGE CLASSIFICATION

Camilo De La Torre

University Toulouse Capitole, France
IRIT - CNRS UMR5505

Giorgia Nadizar

University of Trieste, Italy

Yuri Lavinas

University Toulouse Capitole, France
IRIT - CNRS UMR5505

Robin Schwob

Centre Hospitalo-Universitaire de Toulouse, France

Camille Franchet

Oncopole Claudius Regaud, Toulouse, France

Hervé Luga

Université Toulouse Jean Jaures, France
IRIT - CNRS UMR5505

Dennis Wilson

ISAE-SUPAERO, University of Toulouse, France

Sylvain Cussat-Blanc

University Toulouse Capitole, France
IRIT - CNRS UMR5505
Institut Universitaire de France

ABSTRACT

This article presents an interpretable approach to binary image classification using Genetic Pro-
gramming (GP), applied to the PatchCamelyon (PCAM) dataset, which contains small tissue biopsy
patches labeled as malignant or benign. While Deep Neural Networks (DNNs) achieve high perfor-
mance in image classification, their opaque decision-making processes, prone to overfitting behavior
and dependency on large amounts of annotated data limit their utility in critical fields like digital
pathology, where interpretability is essential. To address this, we employ GP, specifically using the
Multi-Modal Adaptive Graph Evolution (MAGE) framework, to evolve end-to-end image classifica-
tion pipelines. We trained MAGE a hundred times with the best optimized key hyperparameters for
this task. Among all MAGE models trained, the best one achieved 78% accuracy on the validation
set and 76% accuracy on the test set. Among Convolutional Neural Networks (CNNs), our base-
line, the best model obtained 84.5% accuracy on the validation set and 77.1% accuracy on the test
set. Unlike CNNs, our GP approach enables program-level transparency, facilitating interpretability
through example-based reasoning. By analyzing evolved programs with medical experts, we high-
light the transparency of decision-making in MAGE pipelines, offering an interpretable alternative
for medical image classification tasks where model interpretability is paramount.

**Keywords** Image Classification · Genetic Programming · Interpretable Machine Learning.

# 1 Introduction

Image classification has become an integral tool across various fields like robotics, transportation, security, and health-
care. Today, Deep Neural Network (DNN) architectures dominate the field, owing to their ability to learn hierarchical
feature representations directly from raw pixel data and achieve translation invariance [16, 39]. However, despite these
advances, Deep Learning (DL) methods are not without limitations. DNNs are difficult to interpret, and their decision-
making process is blurred and opaque [4]. These models are typically “black boxes”, offering little insight into how
decisions are made, which can undermine trust in their results. Additionally, DNNs often require large labeled datasets
and extensive computational resources to achieve competitive performance [35], making them challenging to deploy
in scenarios with limited data [24]. Trained networks are also susceptible to data drifts and are not robust against adversarial data [12].

Certain fields, such as digital pathology, are considered critical due to their direct impact on real-life outcomes. In these areas, there is a strong demand for models that deliver accurate predictions and are fully transparent and interpretable [4]. Consequently, alternative Machine Learning (ML) approaches that prioritize interpretability and robustness are gaining increasing attention [2, 31, 32].

One such alternative is Genetic Programming (GP), a form of evolutionary computation that evolves programs to solve complex tasks [15]. GP leverages principles of natural selection, where populations of programs are evolved over generations to optimize a given objective. GP has been applied to image classification in various ways, from classifying images based on manual feature extraction data [29] to serving as a feature extractor for non-GP classifiers [5, 11]. In addition, GP has also been used for end-to-end pipelines where both feature extraction and classification are automated, eliminating the need for manual feature engineering [3, 7]. Finally, there is some emerging literature that explores the intrinsic interpretability of GP algorithms [22].

Given the demand for both performance and interpretability in critical domains such as medical image classification, and GP's potential to create interpretable image transformation pipelines, we investigate Multi-Modal Adaptive Graph Evolution (MAGE) [9, 10], an extension of Cartesian Genetic Programming (CGP) [23] developed specifically to handle multiple data types. MAGE can evolve end-to-end image classification pipelines to perform both feature extraction and classification within a single evolutionary process. In this work, we show that MAGE achieves performance levels comparable to standard Convolutional Neural Networks (CNNs) while remaining fully interpretable by medical experts. Leveraging the “white-box” nature of CGP, medical professionals are able to assess the strengths and limitations of the best solutions, allowing them to delineate their coherence, robustness, and potential applicability.

In the following section, we review the application of GP in image classification, particularly its potential for creating end-to-end image processing pipelines. We also discuss successful classification methods applied to the PatchCame LYON (PCAM) dataset. We then detail our use of the MAGE framework for image classification, focusing on our choices for output representation and fitness function. This is followed by a description of the hyperparameter tuning performed for MAGE and the CNN benchmarks conducted for comparison. Next, we present our results for both MAGE and CNNs, demonstrating MAGE’s competitive performance. We also provide a medically guided interpretation of a pipeline’s prediction to highlight the advantages of a fully decomposable and transparent approach. Finally, we discuss our findings and offer concluding remarks.

# 2 Related Work

## 2.1 GP and image processing

In recent years, the field of image classification has seen significant advances, especially with the use of DNNs, and specialized architectures well suited for classification [30]. However, the complexity and “black-box” nature of DNNs, as well as their need for large training data, motivate the study of alternative approaches [4, 21, 31]. One such approach is the use of GP techniques, which have shown promise in various image-processing tasks [14] and interpretability [22, 27].

GP is a subfield of evolutionary computation in which populations of computer programs are evolved to solve complex problems by mimicking the principles of natural selection and genetic evolution [15]. GP encodes potential program solutions, which are iteratively refined over generations through genetic operations such as mutation, crossover, and selection. GP has been successfully applied in various stages of image classification tasks, offering flexibility in both feature extraction and classification processes. Initially, GP was employed to classify images based on manually extracted features, where it functioned as a classifier utilizing predefined input features to distinguish between image classes [29]. GP has also been utilized as a feature extraction method, generating meaningful features that are subsequently used by non-GP classifiers, such as support vector machines or decision trees, to complete the classification task [1, 5, 11]. GP has also been used as an end-to-end image classification pipeline, where both feature extraction and classification are automated within a single evolutionary process. In [3, 7] GP automatically discovers feature representations while simultaneously evolving the final stage classifier responsible for making predictions. However, in both of these works, programs follow a fixed and rigid grammatical structure (filtering, aggregation, classification) instead of a dynamic one as in MAGE.

Among the different implementations of GP, CGP is notable for representing programs as a directed acyclic graph of operations, using a grid of nodes rather than the traditional tree-based representation found in standard GP [23]. In CGP, the nodes represent computational functions, and the connections between them define the program flow. Harding et al. [13] showed the versatility and generalizability of CGP for several use cases such as image denoising,
cell counting and object detection. Leitner et al. [17] used CGP with high level functions to segment and classify rocks from Mars terrain. More recently, CGP has been used for genetic improvement of pre-defined programs for image segmentation [6]. Lastly, CGP achieved close to State-of-the-art (SOTA) performance at cell instance segmentation, by using computer vision operations and requiring little training data [8]. MAGE [9, 10], a typed extension of CGP (akin to Strongly-typed GP [25] and Push GP [33]), handles natively data and operations of different types, enabling the efficient search of “image-to-class” pipelines. This recent advancement enables the application of CGP to a broader range of standard ML tasks, including classification, where multiple data types are involved.

## 2.2 The PCAM dataset

We test our approach on the PCAM dataset [38], a balanced set of images derived from lymph node whole-slide images (WSI), labeled as either malignant or benign. Classification of the images in this dataset is challenging due to high variability, staining differences, and the limited information contained within small image patches.

The PCAM dataset is derived from the Camelyon16 (CAM16) dataset [19], a benchmark in the field of computational pathology, aimed at detecting metastases in WSIs of lymph node sections. The CAM16 dataset includes over 400 WSIs labeled for the presence or absence of metastases. The challenge associated with CAM16 lies in the different magnification levels and complex nature of histopathological images, which exhibit high heterogeneity in tissue types, staining protocols, and scanning devices [34].

The PCAM dataset used here consists of a balanced subset of color images (96 × 96 pixels) which are labeled in a binary fashion into malignant and benign patches [38]. A total of 327,680 images are available, 80% are reserved for training (262 144 images), 10% for validation, and 10% for testing (32 768 images each). There is no overlap in WSI between these different splits. To generate the patches, PCAM follows the same splits as in CAM16, and WSI are randomly selected so as to enforce label balance across patches. A patch is labeled as a positive instance (malignant) if the center 32 × 32 pixel region contains, at least, one positively labeled pixel in the CAM16 WSI. According to PCAM's documentation<fnref n="1" />, the exterior of the center region is independent from the center's label. That is, the presence (or not) of malignancy in the exterior of the center region should not influence the patch's label. However, this padding is preserved for convenience, in order to allow for the use of some convolutional layers that do not use zero-padding.

On this dataset, particular CNN architectures have shown remarkable performance. [38] proposed Group Equivariant Dense Networks in order to exploit the fact that histopathological images are symmetric under rotation, reflection, and translation. The model they proposed (P4M-DenseNet), achieved an accuracy score of 89.8 % on the PCAM test set. Using a Distance Metric Learning-based model, [37] proposed Proxy Neighborhood Component Analysis (ProxyNCA) with a Resnet34 Backbone initially trained on a weakly labeled dataset in digital pathology and then fully trained on the labeled PCAM dataset and achieved 90.47 (± 0.59) % accuracy on the PCAM test set. Another work by the same authors [36] combined a Cross Entropy loss, a Contrastive loss and a Self Perturbation loss as the target of a standard Resnet34 model and achieved 90.36 (± 0.41) % accuracy on the PCAM test set.

# 3 Methods

In this section, we detail our approach to end-to-end image classification using GP, focusing on four main aspects: the choice of our output representation, the architecture of our multi-type MAGE algorithm, the Genetic Algorithm (GA) we opted for to account for dataset size and heterogeneity, and, lastly, the definition of our fitness function.

Most studies that explore end-to-end image classification pipelines using GP use a single output per individual and apply a fixed threshold to differentiate between the two classes [14]. In the present work, we opt for a dual-output approach, where each individual has two programs and each program produces one output.

In an end-to-end image classification pipeline, we expect the system to transform raw images, extract meaningful features, and utilize these characteristics to make accurate classification decisions. To evolve such programs, the operations within them must integrate and effectively combine different data types. To facilitate this search, we employed a type-aware GP approach, ensuring that only type-safe mutations are generated (i.e., mutations where the inputs align with the function's signature) [10]. Specifically, we used an extension of CGP called MAGE to automatically evolve image classification pipelines [10]. For the present use-case of image processing, MAGE genomes are structured into two distinct chromosomes: one dedicated to producing image outputs and the other to generating floating-point outputs. Certain functions perform image-to-image transformations, while others handle scalar-to-scalar operations. Type integration is facilitated by functions that allow floating-point values to parameterize image transformations, as well as those that convert image data into floating-point representations. As stated before, each evolved program generates

<footnote n="1">¹https://github.com/basveeling/pcam</footnote>
two outputs: the final scalar node provides support for the negative class (benign), while the second-to-last scalar node supports the positive class (malignant). Label assignment is made according to the maximum value between the two outputs.

Usually, CGP and its extensions are optimized using the $(1 + \lambda)$ Evolutionary Algorithm (EA). However, the size of the dataset compelled us to use batches of samples to assess the quality of each individual at each iteration. For generalization across iterations, we opted for a more classical GA which retains a portion of its individuals as parents for the next iteration. As such, at each iteration, the best *e* individuals are kept as the elite, and for the next iteration, each offspring will be a mutated copy of its parent, which is chosen with tournament selection between the previously selected elite individuals. As a final note, at each iteration, the best individual in the elite population, according to training metrics, is evaluated against the whole validation dataset for metric tracking.

One advantage of EAs over gradient optimization methods is their ability to directly optimize for the user-desired metric and, optionally, also through a smoother approximate of it. We saw performance improvements when minimizing the error rate ($Err = 1 - Acc$) in addition to a smoother metric like the Negative Log-Likelihood (NLL). Accuracy is defined as $Acc = \frac{TP+TN}{TP+FP+TN+FN}$ where $TP, FP, TN, FN$ denote the number of true positives, false positives, true negatives and false negatives respectively. Since the PCAM dataset is balanced, we argue using error-rate is reasonable. The NLL is a common metric in binary classification defined as $NLL = - \sum_{i=1}^{N} y_i \log(\hat{y}_i) + (1 - y_i) \log(1 - \hat{y}_i)$ where for each instance *i*, $y_i$ refers to ground truth classes (i.e., $\{0, 1\}$) and $\hat{y}_i$ denotes the softmax score for the positive class. The range of NLL for a single instance *i* is $[0; \inf]$, to avoid over penalization for very wrongly predicted instances, we capped the NLL loss at 1 for each $y_i$: $NLL_{ceil} = \min\{NLL, 1\}$. As such, the fitness (or loss $\mathcal{L}$ since we want to minimize it) for each MAGE individual is calculated as $\mathcal{L} = \rho Err + (1 - \rho) NLL_{ceil}$ where $\rho$ is the coefficient that regulates the accuracy importance in the affine combination.

# 4 Experimental Setup

In this work, we explore end-to-end binary image classification using GP, specifically the MAGE framework. Given the dataset's heterogeneity, size, and complexity, we ask: can MAGE be used to construct interpretable classification pipelines without sacrificing substantial performance? To investigate this question, we start by performing hyperparameter tuning with Irace [20], then leverage the optimized parameters to perform a comprehensive comparison against CNNs. Following this, we collaborate with medical experts to interpret one of the most performant solutions. Code for this work is available here $^2$.

## 4.1 Hyperparameter Tuning of MAGE

Due to the use of batches in each iteration and the employment of a GA rather than a $(1 + \lambda)$ EA, we had numerous hyperparameters to fine-tune. To efficiently handle this tuning process, we used the Irace [20] library. Table 1 shows the hyperparameters that we tuned using Irace.

<table><caption>Table 1: Hyperparameters for CGP, GA, and Batch Processing. Irace samples values from these ranges, with the condition that *t* is less than or equal to *e*.</caption><thead><tr><th>Category</th><th>Parameters</th><th>Type</th><th>Values</th></tr></thead><tbody><tr><td rowspan="2">CGP</td><td>Mutation rate (μ)</td><td>Ordinal</td><td>(1,2,3,4)</td></tr><tr><td>Number of nodes (n)</td><td>Ordinal</td><td>(10, 20, 30, 40, 50, 60)</td></tr><tr><td rowspan="4">GA</td><td>Elite size (e)</td><td>Integer</td><td>[2,100]</td></tr><tr><td>New individuals (new)</td><td>Integer</td><td>[2, 1000]</td></tr><tr><td>Tournament size (t)</td><td>Ordinal</td><td>(2, 3, 5, 10, 15, 20)</td></tr><tr><td>ρ</td><td>Real</td><td>[0, 1]</td></tr><tr><td>Batch Processing</td><td>Samples batch (bs)</td><td>Integer</td><td>[5, 2000]</td></tr><tr><td></td><td>Sampling repetitions (reps)</td><td>Integer</td><td>[2,100]</td></tr></tbody></table>

For MAGE, we tuned the μ parameter to target between 1 and 4 active nodes for mutation, as well as the parameter *n*, the genome length, which ranged from 10 to 60 in increments of 10. Notably, for MAGE, genome length refers to the length per chromosome. The key GA parameters included the size of the truncated elite population *e*, which could vary between 2 and 100 individuals. This elite population was carried over from one iteration to the next. From this

<footnote>$^2$https://github.com/camilodlt/evolved_pipelines_imagecls_2024.git</footnote>
population, new individuals were generated through tournament selection of size *t*, with *t* ≤ *e*. The number of offspring per iteration, *new*, was also tuned, ranging from 2 to 1000. Additionally, the loss parameter *ρ*, that balances accuracy and NLL, was tuned between 0 and 1. The batch size, *bs*, ranged from 5 to 2000. To ensure robust fitness statistics for each individual, from one generation to the next, multiple batches were used per iteration (*reps* parameter), allowing us to compute either the median or mean fitness per individual across batches.

Lastly, we used “elitist-Irace” <fnref n="3" /> with a budget of 300 experiments, two runs between statistical tests, and otherwise default parameters. Each run had a budget of 30M evaluations. The bootstrap configuration used was: $\mu = 1, n = 10, e = 2, new = 10, t = 2, bs = 200, reps = 5$ and $\rho = 0.5$.

## 4.2 CNN baselines

In the following section, we compare MAGE against two CNN architectures. First, a Vanilla CNN network with two convolutional layers (with 16 and 32 output channels respectively), max-pooling, and two fully connected layers (with size 128 and 2 respectively) was used. To avoid overfitting, a dropout rate of 0.5 was used in the second to last layer. Second, a standard Resnet18 with approximately 12M parameters. For both networks, data augmentation is performed on the train split, using random horizontal flip and random vertical flip. For all splits, each image is normalized with means and standard deviations per channel calculated on the train split. The Adam optimizer was used for both with a learning rate of $1e^{-5}$.

We used different image channels for this experiment: Red, Green, Blue (RGB), Grayscale (GRAY), Hue, Saturation, Value (HSV), and Haematoxylin, Eosin, DAB (HED). HED channels, in particular, were included based on recommendations from histopathology experts who frequently use them in practice, indicating they may provide valuable information for the model. For the remainder of this work, channels are grouped like this for convenience: *Standard*\* := RGB + HSV, *Standard*\*\dagger := *Standard*\* \cup GRAY, *All*\* := *Standard*\* \cup HED and *All*\*\dagger := *Standard*\*\dagger \cup HED. For MAGE we used *Standard*\*\dagger for hyperparameter tuning and *Standard*\*\dagger and *All*\*\dagger for benchmarking. We also trained the CNN baseline models using various color space combinations: GRAY, RGB, *Standard*\*, and *All*\*, with results reported for each setup.

# 5 Results

## 5.1 Hyperparameter tuning

The Irace algorithm tested a total of 68 different configurations. Figure 1 illustrates the parameter combinations explored. Throughout the iterative process, Irace retained only the configurations that could not be statistically outperformed, progressively refining the search by favoring parameter distributions centered around these successful combinations. A consistent pattern emerged, with mutation rates of 1 or 2 proving reliable. Small genome sizes were particularly effective, with the smallest genome size (10 nodes) being predominantly favored. The number of elite individuals and offspring showed variability, though lower values for both parameters were generally preferred. Tournament sizes of 2 or 3 were consistently selected across Irace's iterations.

Given the limited evaluation budget for each run, robust selection in the face of batch variability required opting for large sample sizes with fewer repetitions or smaller samples with more repetitions. Irace predominantly exploited the latter strategy, choosing moderate batch sizes and evaluating individuals over multiple batches within a single iteration. Lastly, $\rho$ values greater than 0 were consistently favored, indicating a tendency towards configurations that balanced optimization towards both NLL and accuracy. However, since $\rho$ values mostly exceeded 0.5, there is a trend toward prioritizing accuracy as the primary optimization target.

Figure 2 presents the final scores for all configurations, that is, the best validation accuracy achieved during each run. In this box plot, values are negative, as Irace minimizes the objective. The configurations are sorted by their average performance, with the best-performing configurations on the right and the worst on the left. Figure 2 shows that parameter selection has a significant impact on the final performance, with some configurations performing noticeably worse than others. Moreover, nearly all configurations exhibit substantial variability in performance. This suggests that multiple runs with the same parameter combination may be required to consistently achieve a highly competitive solution.

The top three configurations, displayed in Table 2, are remarkably similar. These configurations share several common characteristics, including a mutation rate of a single active node, a small genome, a small tournament, and a low number of sampling repetitions (2, 3, or 5). The key differences among them lie in: the number of elite individuals (ranging

<footnote n="3">³https://cran.r-project.org/web/packages/irace/vignettes/irace-package.pdf</footnote>
<figure><img src="image_3.png" /><figcaption>Figure 1: All configurations tried by Irace. A line represents a combination of parameters. Black lines denote the three best combinations overall.</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Figure 2: Validation accuracy box plots per Irace configuration tested. Parameter configurations are sorted from worst to best on the horizontal axis.</figcaption></figure>

from 2 to 16), the number of offspring (from 10 to 321), the size of each sampled batch (97 to 237 images), and the $ρ$ value, which varied between 0.5 and 0.87.

These results show that multiple parameter combinations can achieve competitive performance. It is important to note, however, that the combinations found are influenced by the bootstrap parameter combination used and the evaluation budget per run, with more promising but evolutionary expensive configurations potentially requiring a higher budget. Further analysis of the tuning process is included in the supplementary materials.

<table><caption>Table 2: Best parameters combinations found and their mean accuracy score.</caption><thead><tr><th>μ</th><th>n</th><th>e</th><th>new</th><th>t</th><th>bs</th><th>reps</th><th>ρ</th><th>Avg. Val. Acc. (Std.)</th></tr></thead><tbody><tr><td>1</td><td>10</td><td>6</td><td>14</td><td>3</td><td>97</td><td>3</td><td>0.5188</td><td><strong>0.746</strong> (0.02)</td></tr><tr><td>1</td><td>10</td><td>16</td><td>321</td><td>2</td><td>237</td><td>2</td><td>0.8759</td><td>0.73 (0.03)</td></tr><tr><td>1</td><td>10</td><td>2</td><td>10</td><td>2</td><td>200</td><td>5</td><td>0.5</td><td>0.736 (0.03)</td></tr></tbody></table>

## 5.2 Benchmarking against CNNs

We conducted 100 runs with the best hyperparameter configuration found by Irace. Given the stochastic nature of each run, various image classification pipelines were generated. As illustrated in Figure 2, there is notable variability in validation accuracy, even among the top-performing configurations. This variability emphasizes the necessity to conduct multiple independent runs to ensure the identification of high-quality solutions. Furthermore, the stochastic nature of the optimization process can be regarded as a beneficial characteristic. This is similar to how Quality-Diversity (QD) can be used to provide effective yet diverse solutions [26]. This diversity provides decision-makers with a range of high-performing pipelines to choose from which enables them to select classifiers based on specific criteria or preferences such as interpretability, simplicity or inference speed. Although interpretability can be considered a subjective criterion [28], diversity in interpretative classifiers is essential to build trust in algorithmic decisions.
To benchmark our method, we trained, from scratch, all CNN models under four different input sets, each for a maximum of 100 epochs: GRAY, RGB, *Standard*\*, and *All*\*. Table 3 reports the training and test accuracy of neural network weights which yield the highest validation accuracy for each input set. Table 3 also shows at which epoch (i.e., after how many processed images) did the model find these optimal weights. As for MAGE, for each run, the final solution is the pipeline with the highest validation accuracy across all iterations. In Table 3, for each input set, we show MAGE's best and average performance across the hundred runs. For the channel combination *All*† we also show the performance of the most interpretable pipeline out of the top three.

On average, MAGE achieved a validation accuracy score of 74.2% with *Standard*† and 74.8% with *All*† inputs. Over all MAGE runs, the solution with the highest validation accuracy (MAGE$^{val*}$) reached 78% using *All*† inputs. This model, MAGE$^{val*}$, achieved 76% accuracy on the test set. Finally, the solution MAGE$^{interp.*}$ was chosen with medical experts as the most interpretable one out of the top three using *All*†, it achieved a validation accuracy of 76.8% and a test accuracy of 74%.

<table><caption>Table 3: Best training, validation (Val.), and test accuracy scores for all models. For each method, the best model(s) found with respect to the validation set (i.e., weights for DNNs or program for MAGE) served to report all metrics. Standard deviation is reported for averages.</caption><thead><tr><th>Model</th><th>Input</th><th>Train %</th><th>Val. %</th><th>Test %</th><th># images (epoch)</th></tr></thead><tbody><tr><td rowspan="4">Vanilla CNN</td><td>GRAY</td><td>88.0</td><td>82.7</td><td>80.9</td><td>22.8M (87)</td></tr><tr><td>RGB</td><td>91.9</td><td>84.1</td><td>80.5</td><td>22.3M (85)</td></tr><tr><td>Standard*</td><td>92.3</td><td>83.6</td><td>78.5</td><td>24.9M (95)</td></tr><tr><td>All*</td><td>89.3</td><td>84.5</td><td>77.1</td><td>11.3M (43)</td></tr><tr><td rowspan="4">Resnet18</td><td>GRAY</td><td>89.9</td><td>80.2</td><td>77.1</td><td>2.6M (10)</td></tr><tr><td>RGB</td><td>87.2</td><td>81.9</td><td>77.4</td><td>786K (3)</td></tr><tr><td>Standard*</td><td>99.</td><td>82.1</td><td>77.1</td><td>13.1M (50)</td></tr><tr><td>All*</td><td>95.6</td><td>84.3</td><td>79.</td><td>4.2M (16)</td></tr><tr><td>MAGE<sup>val*</sup></td><td>Standard†</td><td>74.2</td><td>76.7</td><td>73.3</td><td>1.1M</td></tr><tr><td>Avg. MAGE</td><td>Standard†</td><td>72.3 (1.9)</td><td>74.2 (2.0)</td><td>71. (2.5)</td><td>822K</td></tr><tr><td>MAGE<sup>val*</sup></td><td>All†</td><td>72.9</td><td>78.0</td><td>76.0</td><td>1.3M</td></tr><tr><td>MAGE<sup>interp.*</sup></td><td>All†</td><td>71.8</td><td>76.8</td><td>74.0</td><td>571K</td></tr><tr><td>Avg. MAGE</td><td>All†</td><td>72.3 (1.6)</td><td>74.8 (1.9)</td><td>72.0 (1.8)</td><td>947K</td></tr></tbody></table>

The results in Table 3 show that all CNN models overfitted the data, with training accuracy being consistently higher than validation accuracy. Among these, Vanilla CNNs demonstrated comparable validation accuracy performance across input sets, with the model trained on *All*\* achieving the highest validation score out of all models (84.5%) but only 77.1% accuracy on the test set. Resnet18 models trained on *Standard*\* or *All*\* performed better on validation accuracy than those trained on RGB or GRAY (82.1%, 84.3% and 81.9, 80.2%, respectively). Globally, both the Resnet18 and Vanilla CNN performed similarly on the validation set, which is surprising, given the difference in model size and complexity. It was actually the smaller models that proved to be more generalizable, according to the test metrics, indicating a tendency for larger models to overfit the data.

When comparing our method to CNNs, we observe that CNNs consistently achieve higher performance. Figure 3 shows this comparison with a common axis, namely, the number of images processed by each algorithm. However, despite being a few percentage points below CNNs in accuracy, our algorithm remains competitive. This is particularly noteworthy given the significant difference in complexity between the models. CNNs are highly sophisticated and resource-intensive, while our approach is built on a simpler, more transparent pipeline. This raises an important question: is the marginal gain in accuracy worth the added complexity? In certain applications, especially in fields requiring transparency, a slight trade-off in accuracy may be justified if it results in a more interpretable decision-making process.

In Figure 3 we observe that across all MAGE runs, the best accuracy scores rapidly approach their peak within just a few generations, suggesting that our approach rapidly generalizes well to unseen data without even processing the dataset in its entirety. Such a characteristic is particularly desirable in scenarios where generating or querying abundant data is costly, or when data availability is limited. Table 3 further highlights that MAGE processes images significantly fewer times before converging than CNNs. While CNN typically require dozens of passes through the dataset except for the Resnet18 trained on RGB inputs, MAGE, on average, found its best solution after three passes over the dataset
<figure><img src="image_5.png" /><figcaption>Figure 3: Models’ accuracy scores. For MAGE curves, colors indicate data splits, solid lines represent the average accuracy over 100 runs and ribbon denotes ±1 standard deviation. Dotted lines mark MAGE’s maximum accuracy scores across all runs at each generation. The best-performing Vanilla CNN and ResNet18 models are displayed in distinct colors. Dashed lines correspond to training set accuracy, while solid lines denote validation accuracy. X-axis ticks are proportional to the dataset’s size.</figcaption></figure>

(947K images with *All*† inputs). Additionally, the most interpretable model (MAGE *interp.*\*) required only slightly more than two passes. This data-efficiency makes our approach a strong candidate for an anytime algorithm.

# 6 Interpretability

Interpretability is essential, especially in domains such as digital pathology, where model predictions directly impact patient care and treatment decisions [4]. In these fields, the ability to understand a model’s decision-making process increases trust and also ensures that the model bases its reasoning on medically relevant features rather than unintended biases.

The GP-evolved pipeline we present here is inherently interpretable. It achieves transparency through both simulatability and decomposability [18]. Simulatability allows users to follow the program’s decision-making steps in a reasonable time. Decomposability enables users to examine individual components of the model, helping to break down its operations. Because GP-evolved programs are decomposable by design, they are good candidates for “explanation by example”. A series of examples and counterexamples can be used to illustrate its rationale on a case-by-case basis, as well as its limitations.

From the five most performant models based on validation accuracy, medical experts chose the most interpretable one after analyzing their behavior on a series of cases. In Figure 4 we examine a correct classification of a malignant case made by the model. By examining the sequence of operations, we can observe how specific patterns (e.g., tissue characteristics or absence of benign markers) guide the model toward a malignant classification. This example provides insight into the features the model considers for its classification.

The pipeline in Figure 4 presents mainly two strategies for classifying patches. The first program, which detects benign characteristics, focuses uniquely on the heterogeneity of the Hue channel. This channel is very heterogeneous on images presenting a lot of very bright pixels and homogenous otherwise. As such, by counting the number of different unique pixel values, it can infer the predominance of non-nuclei information. The second program focuses on nuclei information revealed in the Haematoxylin channel. By applying an edge detection filter, the program can get a rough idea of the number and shape of cell nuclei. Background artifacts are removed after applying a mask that focuses on darker parts in the Grayscale channel. A segmentation algorithm, “fastscanning”, detects close structures that do not differ too much in pixel intensity, assigning a different gray level to each one. Lastly, the program counts the number of such segments.

Although not shown here, a correctly classified benign instance is often characterized by a low or high value from program 1 (depending on bright pixels proportion) but, most importantly, a very low value from the second program. The latter output is explained by the fact that a patch populated by homogenous and numerous nuclei results in many detected edges. The “fastscanning” segmentation algorithm finds too many segments to fit them in Uint8 precision, hence, returning a value of 0 across all pixels. In other words, a homogeneous nuclei region produces an excessive number of segments, which overflows the image’s precision and yields a single color, therefore, an output of 1, typi-
<figure><img src="image_6.png" /><figcaption>Figure 4: Example of a correctly classified image by the chosen pipeline. Original channels are shown at the top. The RGB image is shown for understandability purposes, but it is not available as an input. The pipeline produces two outputs, the first (79.) is the support for the benign class and the second the support for the malignant class (90.). The highest number is chosen as the predicted class, in this case, a correct prediction of malignant tissue. Outputs are the results of a series of operations applied to inputs and intermediary outputs.</figcaption></figure>

cally lower than the output from the first program. This behavior can be seen as a systematic conditional mechanism, similar to an if-else statement. Three benign and three malignant examples paired with the predictions from the three best models are available in the supplementary materials.

The full decomposition of a model also reveals its limitations. By analyzing the cases it classifies correctly and incorrectly, we can discern scenarios where the model may be less effective. For instance, the model reasons largely on the whole patch level. Because of this, if a clear malignant nucleus appears in an otherwise white patch, the model will be overconfident about its benign prediction.

Finally, interpretability can enable us to assess how closely the model aligns with the reasoning of medical professionals. For instance, experts recommended adding the HED channels, and these were frequently leveraged by the top-performing pipelines and improved their accuracy. Incorporating more expert feedback and domain-specific building blocks are important future steps.

# 7 Conclusion

In summary, this work demonstrates the development of an interpretable GP approach to binary image classification using the PCAM dataset. Specifically, we focused on the MAGE framework, an extension of CGP, for evolving multi-type and end-to-end image classification pipelines. The PCAM dataset presents a collection of image patches of lymph node biopsies in which malignancy must be detected. It is a challenging dataset because of its size and heterogeneity.

We performed hyperparameter tuning to identify the best strategy for enhancing program performance and improving generalizability to unseen images. We trained MAGE a hundred times with the best hyperparameters found. The MAGE solution with the highest validation accuracy (78%) achieved a test accuracy of 76%. In general, programs were remarkably robust to overfitting and their performance was consistent between them, with an average validation accuracy of 74.8% (±1.9%) and average test accuracy of 72% (±1.8%). We trained several CNN architectures from scratch in order to form a baseline of comparison. The best CNN model, on the validation set, achieved 84.5% validation accuracy and 77.1% test accuracy. For this dataset, the SOTA, which uses complex CNN architectures, sits at around 90% accuracy on the test set.

Although our approach sacrifices some accuracy points, it demonstrates that interpretable image classification is achievable with GP. The evolved programs are fully transparent, and through close collaboration with medical experts, we decomposed one of them to showcase the pipeline's decision-making process. This collaboration offered
valuable insights into the program's logic, underscoring the importance of interpretable GP-based models as a viable alternative to 'black-box' approaches in medical image classification.

## Acknowledgments

This project used compute resources from the CALMIP projects P21049 and P24042. The authors have no competing interests to declare that are relevant to the content of this article.

## References

[1] Ain, Q.U., Al-Sahaf, H., Xue, B., Zhang, M.: Genetic programming for malignancy diagnosis from breast cancer histopathological images: A feature learning approach. IEEE Transactions on Emerging Topics in Computational Intelligence (2025)

[2] Amann, J., Blasimme, A., Vayena, E., Frey, D., Madai, V.I., the Precise4Q consortium: Explainability for artificial intelligence in healthcare: a multidisciplinary perspective. BMC Medical Informatics and Decision Making **20**(1), 310 (Nov 2020). https://doi.org/10.1186/s12911-020-01332-6, https://doi.org/10.1186/s12911-020-01332-6

[3] Atkins, D., Neshatian, K., Zhang, M.: A domain independent Genetic Programming approach to automatic feature extraction for image classification. In: 2011 IEEE Congress of Evolutionary Computation (CEC). pp. 238–245 (Jun 2011). https://doi.org/10.1109/CEC.2011.5949624, https://ieeexplore.ieee.org/document/5949624, ISSN: 1941-0026

[4] Barredo Arrieta, A., Díaz-Rodríguez, N., Del Ser, J., Bennetot, A., Tabik, S., Barbado, A., Garcia, S., Gil-Lopez, S., Molina, D., Benjamins, R., Chatila, R., Herrera, F.: Explainable Artificial Intelligence (XAI): Concepts, taxonomies, opportunities and challenges toward responsible AI. Information Fusion **58**, 82–115 (Jun 2020). https://doi.org/10.1016/j.inffus.2019.12.012, https://www.sciencedirect.com/science/article/pii/S1566253519308103

[5] Bi, Y., Xue, B., Zhang, M.: Genetic Programming With Image-Related Operators and a Flexible Program Structure for Feature Learning in Image Classification. IEEE Transactions on Evolutionary Computation **25**(1), 87–101 (Feb 2021). https://doi.org/10.1109/TEVC.2020.3002229, https://ieeexplore.ieee.org/document/9117044, conference Name: IEEE Transactions on Evolutionary Computation

[6] Biau, J., Wilson, D., Cussat-Blanc, S., Luga, H.: Improving Image Filters with Cartesian Genetic Programming. In: Proceedings of the 13th International Joint Conference on Computational Intelligence. pp. 17–27. SCITEPRESS - Science and Technology Publications, Valletta, Malta (2021). https://doi.org/10.5220/0010640000003063, https://www.scitepress.org/DigitalLibrary/Link.aspx?doi=10.5220/0010640000003063

[7] Burks, A.R., Punch, W.F.: Genetic programming for tuberculosis screening from raw X-ray images. In: Proceedings of the Genetic and Evolutionary Computation Conference. pp. 1214–1221. GECCO '18, Association for Computing Machinery, New York, NY, USA (Jul 2018). https://doi.org/10.1145/3205455.3205461, https://doi.org/10.1145/3205455.3205461

[8] Cortacero, K., McKenzie, B., Müller, S., Khazen, R., Lafouresse, F., Corsaut, G., Van Acker, N., Frenois, F.X., Lamant, L., Meyer, N., Vergier, B., Wilson, D.G., Luga, H., Staufer, O., Dustin, M.L., Valitutti, S., Cussat-Blanc, S.: Evolutionary design of explainable algorithms for biomedical image segmentation. Nature Communications **14**(1), 7112 (Nov 2023), https://www.nature.com/articles/s41467-023-42664-x

[9] De La Torre, C., Cortacero, K., Cussat-Blanc, S., Wilson, D.: Multimodal Adaptive Graph Evolution. In: Proceedings of the Genetic and Evolutionary Computation Conference Companion. pp. 499–502. GECCO '24 Companion, Association for Computing Machinery, New York, NY, USA (Aug 2024). https://doi.org/10.1145/3638530.3654347, https://doi.org/10.1145/3638530.3654347

[10] De La Torre, C., Lavinas, Y., Cortacero, K., Luga, H., Wilson, D.G., Cussat-Blanc, S.: Multimodal Adaptive Graph Evolution for Program Synthesis. In: Affenzeller, M., Winkler, S.M., Kononova, A.V., Trautmann, H., Tušar, T., Machado, P., Bäck, T. (eds.) Parallel Problem Solving from Nature – PPSN XVIII. pp. 306–321. Springer Nature Switzerland, Cham (2024). https://doi.org/10.1007/978-3-031-70055-2_9

[11] Fan, Q., Bi, Y., Xue, B., Zhang, M.: A Multi-Tree Genetic Programming-Based Ensemble Approach to Image Classification With Limited Training Data [Research Frontier]. IEEE Computational Intelligence Magazine **19**(4), 47–62 (Nov 2024). https://doi.org/10.1109/MCI.2024.3446148, https://ieeexplore.ieee.org/document/10709804, conference Name: IEEE Computational Intelligence Magazine
[12] Goodfellow, I.J., Shlens, J., Szegedy, C.: Explaining and Harnessing Adversarial Examples (Mar 2015). https://doi.org/10.48550/arXiv.1412.6572, http://arxiv.org/abs/1412.6572, arXiv:1412.6572

[13] Harding, S., Leitner, J., Schmidhuber, J.: Cartesian Genetic Programming for Image Processing. In: Riolo, R., Vladislavleva, E., Ritchie, M.D., Moore, J.H. (eds.) Genetic Programming Theory and Practice X. Genetic and Evolutionary Computation, Springer, New York, NY (2013)

[14] Khan, A., Qureshi, A.S., Wahab, N., Hussain, M., Hamza, M.Y.: A recent survey on the applications of genetic programming in image processing. Computational Intelligence **37**(4), 1745–1778 (2021). https://doi.org/10.1111/coin.12459, https://onlinelibrary.wiley.com/doi/abs/10.1111/coin.12459, _eprint: https://onlinelibrary.wiley.com/doi/pdf/10.1111/coin.12459

[15] Koza, J.R.: Genetic programming as a means for programming computers by natural selection. Statistics and Computing **4**(2), 87–112 (Jun 1994). https://doi.org/10.1007/BF00175355, https://doi.org/10.1007/BF00175355

[16] LeCun, Y., Bengio, Y., Hinton, G.: Deep learning. Nature **521**(7553), 436–444 (May 2015). https://doi.org/10.1038/nature14539, https://www.nature.com/articles/nature14539, publisher: Nature Publishing Group

[17] Leitner, J., Harding, S., Forster, A., Schmidhuber, J.: Mars Terrain Image Classification using Cartesian Genetic Programming. In: Proceedings of the 11th International Symposium on Artificial Intelligence, Robotics and Automation in Space, i-SAIRAS 2012. pp. 1–8. European Space Agency (ESA) (2012)

[18] Lipton, Z.C.: The Mythos of Model Interpretability: In machine learning, the concept of interpretability is both important and slippery. Queue **16**(3), 31–57 (Jun 2018). https://doi.org/10.1145/3236386.3241340, https://dl.acm.org/doi/10.1145/3236386.3241340

[19] Litjens, G., Bandi, P., Ehteshami Bejnordi, B., Geessink, O., Balkenhol, M., Bult, P., Halilovic, A., Hermsen, M., van de Loo, R., Vogels, R., Manson, Q.F., Stathonikos, N., Baidoshvili, A., van Diest, P., Wauters, C., van Dijk, M., van der Laak, J.: 1399 H&E-stained sentinel lymph node sections of breast cancer patients: the CAMELYON dataset. GigaScience **7**(6), giy065 (May 2018). https://doi.org/10.1093/gigascience/giy065, https://pmc.ncbi.nlm.nih.gov/articles/PMC6007545/

[20] López-Ibáñez, M., Dubois-Lacoste, J., Pérez Cáceres, L., Birattari, M., Stützle, T.: The irace package: Iterated racing for automatic algorithm configuration. Operations Research Perspectives **3**, 43–58 (Jan 2016). https://doi.org/10.1016/j.orp.2016.09.002, https://www.sciencedirect.com/science/article/pii/S2214716015300270

[21] Marcus, G.: Deep Learning: A Critical Appraisal (Jan 2018). https://doi.org/10.48550/arXiv.1801.00631, http://arxiv.org/abs/1801.00631, arXiv:1801.00631

[22] Mei, Y., Chen, Q., Lensen, A., Xue, B., Zhang, M.: Explainable Artificial Intelligence by Genetic Programming: A Survey. IEEE Transactions on Evolutionary Computation **27**(3), 621–641 (Jun 2023). https://doi.org/10.1109/TEVC.2022.3225509, https://ieeexplore.ieee.org/abstract/document/9965435, conference Name: IEEE Transactions on Evolutionary Computation

[23] Miller, J.F., Thomson, P.: Cartesian Genetic Programming. In: Poli, R., Banzhaf, W., Langdon, W.B., Miller, J., Nordin, P., Fogarty, T.C. (eds.) Genetic Programming. Lecture Notes in Computer Science, Springer, Berlin, Heidelberg (2000)

[24] Miotto, R., Wang, F., Wang, S., Jiang, X., Dudley, J.T.: Deep learning for healthcare: review, opportunities and challenges. Briefings in Bioinformatics **19**(6), 1236–1246 (Nov 2018). https://doi.org/10.1093/bib/bbx044, https://doi.org/10.1093/bib/bbx044

[25] Montana, D.J.: Strongly typed genetic programming. Evol. Comput. **3**(2), 199–230 (Jun 1995). https://doi.org/10.1162/evco.1995.3.2.199, https://dl.acm.org/doi/10.1162/evco.1995.3.2.199

[26] Nadizar, G., Medvet, E., Wilson, D.: Searching for a Diversity of Interpretable Graph Control Policies. In: Proceedings of the Genetic and Evolutionary Computation Conference. pp. 933–941. GECCO ’24, Association for Computing Machinery, New York, NY, USA (Jul 2024). https://doi.org/10.1145/3638529.3653987, https://doi.org/10.1145/3638529.3653987

[27] Nadizar, G., Medvet, E., Wilson, D.G.: Naturally interpretable control policies via graph-based genetic programming. In: European Conference on Genetic Programming (Part of EvoStar). pp. 73–89. Springer (2024)

[28] Nadizar, G., Rovito, L., De Lorenzo, A., Medvet, E., Virgolin, M.: An analysis of the ingredients for learning interpretable symbolic regression models with human-in-the-loop and genetic programming. ACM Transactions on Evolutionary Learning and Optimization **4**(1), 1–30 (2024)
[29] Nandi, R.J., Nandi, A.K., Rangayyan, R.M., Scutt, D.: Classification of breast masses in mammograms using genetic programming and feature selection. Medical and Biological Engineering and Computing **44**(8), 683–694 (Aug 2006).
https://doi.org/10.1007/s11517-006-0077-6, https://doi.org/10.1007/s11517-006-0077-6

[30] Rawat, W., Wang, Z.: Deep Convolutional Neural Networks for Image Classification: A Comprehensive Review. Neural Computation **29**(9), 2352–2449 (Sep 2017). https://doi.org/10.1162/NECOa00990

[31] Rudin, C.: Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence **1**(5), 206–215 (May 2019). https://doi.org/10.1038/s42256-019-0048-x, https://www.nature.com/articles/s42256-019-0048-x, publisher: Nature Publishing Group

[32] Sheu, R.K., Pardeshi, M.S.: A Survey on Medical Explainable AI (XAI): Recent Progress, Explainability Approach, Human Interaction and Scoring System. Sensors (Basel, Switzerland) **22**(20), 8068 (Oct 2022).
https://doi.org/10.3390/s22208068

[33] Spector, L., Klein, J., Keijzer, M.: The Push3 execution stack and the evolution of control. In: Proceedings of the 7th Annual Conference on Genetic and Evolutionary Computation. pp. 1689–1696. GECCO ’05, Association for Computing Machinery, New York, NY, USA (2005), event-place: Washington DC, USA

[34] Srinidhi, C.L., Ciga, O., Martel, A.L.: Deep neural network models for computational histopathology: A survey. Medical Image Analysis **67**, 101813 (Jan 2021). https://doi.org/10.1016/j.media.2020.101813, https://www.sciencedirect.com/science/article/pii/S1361841520301778

[35] Sun, C., Shrivastava, A., Singh, S., Gupta, A.: Revisiting Unreasonable Effectiveness of Data in Deep Learning Era. In: 2017 IEEE International Conference on Computer Vision (ICCV). pp. 843–852 (Oct 2017).
https://doi.org/10.1109/ICCV.2017.97, https://ieeexplore.ieee.org/document/8237359, iSSN: 2380-7504

[36] Teh, E.W., Taylor, G.W.: Metric Learning for Patch Classification in Digital Pathology (Apr 2019), https://openreview.net/forum?id=BJgtl1V6FN

[37] Teh, E.W., Taylor, G.W.: Learning with Less Data Via Weakly Labeled Patch Classification in Digital Pathology. In: 2020 IEEE 17th International Symposium on Biomedical Imaging (ISBI). pp. 471–475 (Apr 2020).
https://doi.org/10.1109/ISBI45749.2020.9098533, https://ieeexplore.ieee.org/document/9098533, iSSN: 1945-8452

[38] Veeling, B.S., Linmans, J., Winkens, J., Cohen, T., Welling, M.: Rotation Equivariant CNNs for Digital Pathology. In: Frangi, A.F., Schnabel, J.A., Davatzikos, C., Alberola-López, C., Fichtinger, G. (eds.) Medical Image Computing and Computer Assisted Intervention – MICCAI 2018. pp. 210–218. Springer International Publishing, Cham (2018).
https://doi.org/10.1007/978-3-030-00934-2_4

[39] Zeiler, M.D., Fergus, R.: Visualizing and Understanding Convolutional Networks. In: Fleet, D., Pajdla, T., Schiele, B., Tuytelaars, T. (eds.) Computer Vision – ECCV 2014. pp. 818–833. Springer International Publishing, Cham (2014).
https://doi.org/10.1007/978-3-319-10590-1_5