Papers
Topics
Authors
Recent
Search
2000 character limit reached

Wasserstein-Driven Evolutionary Stratification (WDES)

Updated 12 July 2026
  • The paper introduces WDES, a method that uses a genetic algorithm to minimize the 1-D Wasserstein distance between pixel-level label distributions, ensuring representative dataset splits.
  • WDES is shown to achieve lower statistical heterogeneity and reduced fold-to-fold performance variance compared to random splitting and IPS, especially for small or imbalanced datasets.
  • The method leverages cumulative Wasserstein distance and gene-level operations while enforcing fold-size constraints, making its optimization both efficient and scalable.

Wasserstein-Driven Evolutionary Stratification (WDES) is a split-assignment method for image segmentation datasets that frames data partitioning as a discrete optimization problem over pixel-label distributions. Introduced in "Stratify or Die: Rethinking Data Splits in Image Segmentation," WDES uses a genetic algorithm to minimize the average 1-D Wasserstein distance between the global class histogram of a dataset and the class histogram of each fold, with the goal of producing more representative train/test or cross-validation splits. In the reported study, WDES is evaluated against random splitting and Iterative Pixel Stratification (IPS), and is associated with lower statistical heterogeneity, lower fold-to-fold performance variance, and particular utility on small, imbalanced, and low-diversity segmentation datasets (Jami et al., 25 Sep 2025).

1. Problem setting and definition

The method is motivated by the observation that random splitting of datasets in image segmentation often leads to unrepresentative test sets, resulting in biased evaluations and poor model generalization. Although stratified sampling has proven effective for addressing label distribution imbalance in classification tasks, extending these ideas to segmentation remains challenging because segmentation labels are pixel-wise, multi-label at the image level, and often severely imbalanced. WDES addresses this by operating directly on pixel-level class counts rather than on image-level labels alone (Jami et al., 25 Sep 2025).

The formal setting uses a dataset

D={(xn,yn)}n=1N,D=\{(x_n,y_n)\}_{n=1}^{N},

where each image has pixel-wise labels

yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.

A split consists of a partition

S=(S1,,SK),S=(S^1,\ldots,S^K),

with KK folds and target proportions

r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,

such that SkrkN|S^k|\approx r^kN. Let PcP_c denote the total number of pixels of class cc in the full dataset and PckP_c^k the total number of pixels of class cc in fold yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.0.

In this formulation, the central objective is not merely to balance the number of samples per fold, but to make each fold’s pixel-level label distribution resemble the global dataset distribution. This distinguishes WDES from procedures that satisfy sample-count constraints while leaving pixel-label composition substantially heterogeneous.

2. Wasserstein objective and label-distribution matching

WDES treats each fold’s pixel-level class histogram as a discrete distribution over yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.1. The global distribution is defined as

yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.2

where

yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.3

and the fold-specific distribution is

yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.4

Using cumulative sums

yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.5

the 1-D Wasserstein distance of order 1 between yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.6 and yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.7 is written in closed form as

yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.8

The paper describes this as proportional to the classic definition

yn{1,,C}Pn.y_n \in \{1,\ldots,C\}^{P^n}.9

specialized to the discrete 1-D setting (Jami et al., 25 Sep 2025).

The fitness used by WDES is the average over folds, termed the Label Wasserstein Distance (LWD):

S=(S1,,SK),S=(S^1,\ldots,S^K),0

The stratification problem is therefore

S=(S1,,SK),S=(S^1,\ldots,S^K),1

where S=(S1,,SK),S=(S^1,\ldots,S^K),2 is the set of all S=(S1,,SK),S=(S^1,\ldots,S^K),3-way splits of S=(S1,,SK),S=(S^1,\ldots,S^K),4 that respect S=(S1,,SK),S=(S^1,\ldots,S^K),5.

This objective makes explicit that WDES is optimizing similarity of label distributions across dataset splits. A plausible implication is that the method is best understood as a constrained distribution-matching procedure over folds, rather than as a generic evolutionary heuristic for balanced partitioning.

3. Genetic algorithm design

Each individual in the population is represented by a vector

S=(S1,,SK),S=(S^1,\ldots,S^K),6

where S=(S1,,SK),S=(S^1,\ldots,S^K),7 indicates which fold sample S=(S1,,SK),S=(S^1,\ldots,S^K),8 is assigned to. The implementation also stores each sample’s per-class pixel counts S=(S1,,SK),S=(S^1,\ldots,S^K),9 so that fold totals KK0 can be computed by summation. Initial individuals are drawn by assigning each sample randomly to fold KK1 with probability KK2, followed by random reassignment until each fold’s size is either KK3 or KK4. The population size in the paper is KK5 (Jami et al., 25 Sep 2025).

For each candidate assignment KK6, the method computes

KK7

and then evaluates

KK8

Lower KK9 is better, and the paper states that no further normalization is used.

Selection uses tournament selection of size r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,0, with r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,1 in practice: to choose one parent, the algorithm samples r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,2 individuals uniformly with replacement and selects the one with lowest fitness. Crossover is gene-level one-point or two-point crossover. In the two-point case, two crossover points r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,3 are chosen at random, offspring are formed by exchanging the middle segment, and a correction step then enforces fold-size constraints by reassigning excess samples from over-populated folds to under-populated folds in proportion to target deficits.

Mutation operates by swap:

r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,4

applied with probability r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,5, where two distinct sample indices are selected at random. Because mutation swaps fold assignments, it preserves fold-size exactly. In practice, the paper uses r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,6. The algorithm runs for r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,7 generations, with r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,8 in the reported configuration, and employs elitism by always carrying forward the single best individual found so far. After r=(r1,,rK)[0,1]K,krk=1,r=(r^1,\ldots,r^K)\in[0,1]^K,\qquad \sum_k r^k=1,9 generations, it returns the best SkrkN|S^k|\approx r^kN0.

4. Convergence, optimality, and computational profile

The theoretical analysis is stated under standard assumptions for a non-elitist but ergodic genetic algorithm, with Rudolph 1994 and 1996 cited for convergence in finite search spaces. The relevant assumptions are that the mutation operator has a positive probability of reaching any feasible stratification in one step and that elitist replacement is employed so that the best individual never disappears. Under these conditions, if SkrkN|S^k|\approx r^kN1 is the random set of stratifications examined across SkrkN|S^k|\approx r^kN2 individuals over SkrkN|S^k|\approx r^kN3 generations, and

SkrkN|S^k|\approx r^kN4

then the expected suboptimality of the returned solution satisfies

SkrkN|S^k|\approx r^kN5

Moreover, because mutation is ergodic, as SkrkN|S^k|\approx r^kN6 the probability of visiting every SkrkN|S^k|\approx r^kN7 tends to SkrkN|S^k|\approx r^kN8, so WDES converges in probability to the global minimizer of SkrkN|S^k|\approx r^kN9 over all assignments (Jami et al., 25 Sep 2025).

The reported complexity separates fitness evaluation from genetic operators. Fitness evaluation is PcP_c0 per individual once per generation, yielding PcP_c1. Crossover plus correction is PcP_c2 per new individual, for PcP_c3 total. The overall complexity is therefore

PcP_c4

For typical PcP_c5–PcP_c6 K images, PcP_c7–PcP_c8 classes, PcP_c9, and cc0, the method is described as feasible on a modern CPU/GPU, and fitness evaluations can be parallelized over cc1.

The implementation notes also emphasize that the 1-D Wasserstein distance, computed as a cumulative distance, is cc2 and does not require a full cc3 optimal transport solver. By caching each sample’s cc4, fitness can be updated incrementally in cc5 per sample move, and all cc6 fitness computations per generation can be vectorized or parallelized, for example through Python multiprocessing or PyTorch. This suggests that the practical bottleneck is not the Wasserstein computation itself but repeated evaluation across a population under fold-size constraints.

5. Statistical heterogeneity metrics and empirical findings

To quantify how balanced a splitting method is, the paper introduces three statistical heterogeneity metrics. The first is Sample Distribution (SD),

cc7

The second is Pixel Label Distribution (PLD),

cc8

The third is Label Wasserstein Distance (LWD),

cc9

Lower SD, PLD, and LWD all indicate more representative splits. In the experiments, WDES achieves the lowest PLD and LWD across five datasets and matches the ideal SD of random splitting, which already enforces PckP_c^k0 by construction (Jami et al., 25 Sep 2025).

The five reported benchmarks span street scenes, medical endoscopy, satellite imagery, and general-purpose semantic segmentation:

Dataset Size and classes Reported statistics
PascalVOC 2012 2 913 images, 21 classes CC=2.48, CU=344, AIR=79, entropy=1.82
CamVid 701 images, 32 classes CC=17.44, CU=370, AIR=7.56 × 10⁶, entropy=1.94
EndoVis 2018 2 235 images, 12 classes CC=6.00, CU=1 117, AIR=1 492, entropy=2.38
LoveDA 2 522 images, 8 classes CC=4.97, CU=1 568, AIR=4.5, entropy=2.61
Cityscapes 2 974 images, 35 classes CC=16.6, CU=1 412, AIR=467, entropy=3.17

For downstream evaluation, the study trains a U-Net with a ResNet34 backbone using 10-fold cross-validation under each splitting strategy, and measures fold-to-fold standard deviation in accuracy, F1, and IoU. WDES yields the lowest variance in all metrics on low-entropy datasets, specifically PascalVOC and EndoVis, indicating more stable test splits. On high-entropy datasets such as Cityscapes and CamVid, random splits become competitive, because class diversity alone already evens out random folds.

The paper further states that small or low-diversity datasets see the largest PLD/LWD gains, reported as 50–70% relative, together with variance reductions of up to PckP_c^k1 lower standard deviation. As class cardinality CC grows, all methods converge; WDES retains a small edge, but with diminishing returns.

6. Relation to IPS, prior stratification work, and interpretation

WDES is introduced alongside Iterative Pixel Stratification (IPS), described as a straightforward, label-aware sampling method tailored for segmentation tasks. In the heterogeneity results, IPS often overshoots SD because it does not enforce exact sample counts, and its PLD and LWD are worse than WDES. This comparison is important because it separates two notions of balance: exact sample-count control and pixel-label representativeness. The reported experiments indicate that a method may satisfy or nearly satisfy one of these properties without optimizing the other (Jami et al., 25 Sep 2025).

The source paper positions WDES as building on existing stratification concepts. Its references explicitly include Sechidis et al. 2011 on Iterative Stratification for multi-label data and Florez-Revuelta 2021 on Evosplit, a genetic algorithm for multi-label splitting. In this sense, WDES can be situated at the intersection of multi-label stratification and evolutionary search, but specialized for segmentation through pixel-level label accounting and a Wasserstein-based fitness.

A common misconception in this area is that segmentation splits can be treated as a direct extension of classification splits. The framing of WDES argues against that simplification: segmentation combines multi-label image composition with strong class imbalance at pixel resolution, so image-level randomization can yield folds whose label histograms are statistically misaligned even when fold sizes are nominally correct. Conversely, the results also show that WDES is not uniformly dominant in every regime. On high-entropy datasets, random splits become competitive, which suggests that naturally diverse datasets can partially mitigate split bias without explicit optimization.

Within the paper’s own claims, the strongest case for WDES is therefore regime-dependent: its value is most pronounced when datasets are small, imbalanced, or low-diversity, and less pronounced as class diversity and class cardinality increase. That interpretation is consistent with the reported pattern that WDES consistently produces more representative splits, while the magnitude of its empirical advantage narrows when random folds are already stabilized by dataset heterogeneity.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Wasserstein-Driven Evolutionary Stratification (WDES).