# Source paper archive

- Source title: sorAI - a suite of machine learning models to predict plant polyploidy from target capture data
- Author(s): Rahimi, F., Pelosi, J. A., Burleigh, J. G., Zhou, J.
- Source landing URL: https://www.biorxiv.org/content/10.64898/2026.11.10.765735v1
- PDF URL: https://www.biorxiv.org/content/10.64898/2026.11.10.765735v1.full.pdf
- PDF SHA-256: 610a4b9e5abbebd7964c57b311a64281c50496878b45b762d964fe3e7945fa7e
- Converter: pymupdf4llm 0.0.27
- Limits: Automated PDF text extraction; reading order, equations, tables and formatting may be incomplete or incorrect. Images are omitted, and no OCR was performed. Markup and links are neutralized for safe downloading. Consult the original PDF for the authoritative version.

---

&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 1

# 1 sorAI - a suite of machine learning models to predict plant polyploidy 2 from target capture data


3 Fahimeh Rahimi &#91;1&#93;, Jessie A. Pelosi &#91;1,2&#93;, J. Gordon Burleigh &#91;1,3&#93;, JuannanZhou &#91;1,4 &#93;


4 1 Department of Biology, University of Florida, Gainesville FL USA, 2 Department of Ecology and


5 Evolutionary Biology, University of Arizona, Tucson AZ USA, &#91;3&#93; National Science Foundation,


6 Alexandria VA USA, &#91;4&#93; Genetics Institute, University of Florida, Gainesville FL USA


7 **ORCIDs:**


8 F.R.- 0009-0003-5407-4849


9 J.A.P. – 0000-0002-2861-3445


10 J.G.B.– 0000-0001-8120-5136


11 J.Z. - 0000-0002-1373-4746


12 **ABSTRACT**


13 **Premise:**


14 Polyploidy is a persistent feature of land plant evolution, yet it is often difficult to determine the


15 ploidy of individual plants. The growing abundance of target capture data and other high


16 throughput sequence datasets across plant species has generated interest in methods to infer


17 ploidy from these data. We leverage chromosome count data and target capture data from the


18 GoFlag probe set in ferns to train new machine learning models to infer if a sample is from a


19 diploid or polyploid genome.


20 **Methods and Results:**


21 We trained a convolutional neural network (CNN) for each GoFlag probe locus and developed


22 ensemble models that use two loci and a random forest model that leverages all the loci to classify


23 fern samples as diploid or polyploid. We tested the performance of these models using held-out


24 test datasets of GoFlag target capture data across ferns and an independent test set from the


25 genus _Lygodium_ . We also performed experiments to evaluate the features of loci and sequences


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 2


26 most associated with model performance and tested the performance of the models as sequence


27 depth decreased.


28 **Conclusions:**


29 These models, collectively named sorAI, outperform the frequency-based methods nQuire and


30 nQuack on held-out test datasets of GoFlag target capture data across ferns. These models are


31 capable of leveraging positional information and covariation among nucleotide sites beyond


32 individual-site allele frequencies, and they perform well even with low sequence coverage. The


33 random forest model, which uses all loci, appears to be robust to varying dataset features and


34 achieves an accuracy of approximately 71–78% across test datasets and sequencing depths.


35 &#91;sorAI is available at https://github.com/Fahimehgit/sorai, and the trained models are available at&#93;(https://github.com/Fahimehgit/sorai)


36 &#91;https://huggingface.co/Fahimehr140/sorai.&#93;(https://huggingface.co/Fahimehr140/sorai)


37 **KEYWORDS:** ferns, machine learning, ploidy, ploidy inference, polyploidy, targeted capture

## 38 INTRODUCTION


39 Polyploidy is a persistent feature of the evolution of land plants, and botanists have been


40 long interested in the role of polyploidy in speciation, adaptation, and the generation of novel


41 features in plants. Such studies require knowledge of the ploidy level of a diversity of plant


42 samples. Understanding the ploidy also is critical for accurately genotyping plant samples. Yet,


43 determining the ploidy of plant samples often is difficult and requires different lines of evidence.


44 One of the most direct ways to determine the ploidy level of a plant is by comparing the


45 chromosome numbers among closely related taxa. There have been numerous efforts to


46 assemble chromosome count data for plant species (e.g., Manton, 1950; Darlington and Wylie,


47 1956; Henniges et al., 2023; Rice and Mayrose, 2023; Simon et al., 2023). Although chromosome


48 counts exist now for thousands of plant species, these still represent only a small fraction of total


49 extant plant diversity. Furthermore, chromosome counting can be challenging in some plants, and


50 usually requires freshly collected tissue, making it difficult to obtain from historical (i.e., herbarium)


51 collections. Ploidy levels also can be inferred from genome size estimates, generally using flow


52 cytometry (see Dolezel and Bartos, 2005; Kron et al., 2007) or measurements of cell size (e.g.,


53 guard cells in stomata, spores, or pollen; see Stebbins, 1950). However, these indirect correlates


54 of ploidy can be highly variable among closely related taxa with the same ploidy and thus difficult


55 to interpret or potentially misleading.


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 3


56 The availability of large genomic datasets offers a new source of data from which to infer


57 ploidy levels. With high coverage genome sequence data, ploidy can be inferred without a


58 reference sequence from _k_ -mers, or strings of nucleotides of length _k_ (e.g., Ranallo-Benavidez et


59 al., 2020). While there is a rapidly growing number of nearly full plant genome sequences, they


60 still are unavailable for the vast majority of plant species. Ploidy levels also can be inferred from


61 the read frequencies of variable (often biallelic) sites. In these approaches, the high throughput


62 sequencing (HTS) reads first are mapped to reference sequences. The ploidy of samples is then


63 inferred by comparing the observed read frequencies to either expected ratios predicted for


64 different ploidy levels or frequencies observed from simulations of sequences from different ploidy


65 levels. For example, in a diploid each allele should be present in approximately 1/2 of the reads,


66 and in a biallelic triploid site, one allele should be present in 2/3 of the reads, and the other in ⅓.


67 The first software to use this approach was ploidyNGS, which enabled users to evaluate ploidy


68 levels by visually inspecting allele frequency histograms (Augusto Corrêa dos Santos et al., 2017).


69 Later, nQuire enabled users to infer ploidy using a likelihood approach based on the fit of read


70 frequencies at biallelic sites to a Gaussian (i.e., Normal) mixture model (Weiß et al., 2018), and it


71 has been incorporated in protocols designed explicitly to infer ploidy from plant phylogenomic


72 datasets (Viruel et al., 2019, 2023). More recently, nQuack expands upon the methods from


73 nQuire, using a more elaborate statistical framework for evaluating ploidy levels and including


74 arguably more appropriate distributions for the mixture models (Gaynor et al., 2024). Tiley et al.


75 (2023) also developed a variant of nQuire which uses different mixture models and is


76 implemented as part of the PATÉ pipeline for phasing allelic or homeolog sequences (Tiley et al.,


77 2024).


78 While the allele frequency approaches for inferring ploidy can be applied to many types of


79 HTS data, in plants they most often are used with targeted capture data, and some protocols are


80 explicitly designed for these data (e.g., Viruel et al., 2019, 2023; Tiley et al., 2023). Targeted


81 capture is an approach to obtain data from hundreds of nuclear loci at a relatively low cost (e.g.,


82 Cronn et al., 2012; Weitemier et al., 2014; McKain et al., 2018). It generally uses short RNA


83 probes, corresponding to selected loci, to bind to DNA from sequencing libraries. The bound DNA


84 is then sequenced, generating a sequence dataset enriched for the chosen target loci. In plants,


85 probe sets have been designed for extremely large groups of plants, like the Compositae (Mandel


86 et al., 2014; Moore-Pollard, 2024), angiosperms (Johnson et al., 2019), flagellate land plants


87 (Breinholt et al., 2021), the nitrogen-fixing clade within the rosids (Folk et al., 2021), and orchids


88 (Eserman et al., 2021). Because targeted capture usually uses short-read sequencing, it can be


89 effective on old or degraded DNA that may come from herbarium samples (Brewer et al., 2019;


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 4


90 Forrest et al., 2019; Kates et al., 2021). Thus, targeted capture has been used to generate


91 genomic sequences from a rapidly expanding proportion of plant species. While the allele


92 frequency models appear to work well on targeted capture data in some cases (e.g., Gaynor et


93 al., 2024), in others their accuracy has been questioned. In an extreme case, Pelosi et al. (2024)


94 found that the accuracy of nQuire was &lt;30% among samples of vining ferns ( _Lygodiaceae_ ). This


95 poor performance may be due to either the quality or quantity of the sequence data (e.g.,


96 inadequate read depth), and not necessarily inherent flaws in the methods; however, these results


97 suggest that the allele frequency approaches may not perform well on real world plant datasets


98 derived from targeted capture sequencing.


99 The availability of chromosome counts (e.g., Rice and Mayrose, 2023) and targeted


100 capture datasets from thousands of taxa (e.g., Baker et al., 2022) suggests the possibility of a


101 machine learning approach to estimate ploidy. In such a method, instead of comparing aspects


102 of the sequence data (e.g., read counts for different alleles) to theoretical predictions, the machine


103 learning model can be trained on targeted capture datasets of known ploidy and then deployed


104 to predict the ploidy levels for novel samples. Such models would not be limited to bi-allelic


105 frequencies or theoretical predictions, and they may be able to “learn” diagnostic features of ploidy


106 level from the complex, real datasets, such as biases in the allele frequencies due to probe design.


107 They also could incorporate features of the dataset not typically included in allele frequency


108 analyses: for example, they could account for neighboring sites instead of treating each nucleotide


109 site independently, thereby potentially leveraging the distribution of (micro-)haplotypes for


110 prediction. In this study, we describe a new approach that uses machine learning to estimate the


111 ploidy of a sample from raw sequencing reads generated from targeted capture, and we test it


112 with a dataset of ferns. Ferns are a clade of more than 10,000 species (PPG I, 2016) that have


113 long been a model system for studying polyploidy in plants (Manton, 1950; Klekowskiand Baker,


114 1966); an estimated 30% of fern speciation events are associated with a change in ploidy (Wood


115 et al., 2009). The GoFlag 408 flagellate land plant probe set (Breinholt et al., 2021) has been used


116 to generate data from thousands of fern samples, which have been used in numerous


117 evolutionary studies (e.g., Fawcett et al., 2021; Lima et al., 2023; Mendez Reneau et al., 2023,


118 2024; Koubinová et al., 2024; Pelosi et al., 2024; Sigel et al., 2025). We assembled a set of


119 targeted capture data from fern samples from species with ploidy estimates from chromosome


120 counts. We used these data to train new machine learning models to infer if a fern sample is


121 diploid or polyploid. We evaluate the performance of these new models and compare their


122 performance to that of existing methods to infer ploidy. Overall, we found that our models


123 outperform the frequency-based nQuire and nQuack on held-out test datasets, and that the


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 5


124 random forest model, which aggregates predictions across all loci, also outperforms both methods


125 on an independent test set consisting of samples from the genus _Lygodium_ . We further performed


126 model interpretation tasks and showed that our models are capable of leveraging positional


127 information and covariation among nucleotide sites beyond individual-site allele frequencies.

## 128 METHODS


129 **Sampling and Data**


130 First, we obtained a list of chromosome counts from fern species from the Chromosome


131 Counts Database (CCDB; Rice and Mayrose, 2023) and used the chromosome counts to


132 determine which species were diploid or polyploid by comparing chromosome numbers among


133 closely related taxa. We did not distinguish among different types of polyploids (e.g., tetraploids,


134 hexaploids, or octoploids), nor did we distinguish whether the polyploids were allopolyploids or


135 autopolyploids. We then took a list of the species that we determined to be unambiguously diploid


136 or polyploid based on chromosome counts (i.e., species in which all available chromosome counts


137 were consistent with the ploidy designation), and identified samples that the GoFlag project had


138 sequenced using the GoFlag 408 or 451 flagellate land plant probe set. The GoFlag 408 probe


139 set is an optimized subset of the GoFlag 451 probe set (Breinholt et al., 2021), and for all the


140 samples and analyses, we only considered loci from the GoFlag 408 probe set. Each locus in


141 these probe sets represents an exon on a single or low copy nuclear gene that is at least 120


142 base pairs (bp) in length. In total, we found targeted capture sequence datasets from 640 samples


143 generated using the GoFlag 408 flagellate land plant probe set and six samples generated using


144 the GoFlag 451 probe set. Among the chosen samples, the targeted capture sequencing


145 recovered an average of 371 loci, and the reference sequences for the 384 loci used in our


146 analyses have an average length of 190 bp (range: 111–1,068 bp).


147 **Overall workflow**


148 The overall workflow, illustrated in Figure 1A, begins with quality control and


149 preprocessing of raw target-capture reads. Processed samples were then randomly partitioned


150 into non-overlapping training, model-selection validation, and held-out evaluation sets using an


151 80/10/10 split (N = 516, 64, and 66 samples, respectively; Figure 1B).


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 6


152
153 **Figure 1. Machine learning models for identifying polyploids using target capture data.** (A)
154 Overall workflow of our method. The raw target capture reads acquired using the GoFlag flagellate
155 land plant probe set are first processed and filtered. A subset of samples was used as training
156 and validation data to train CNN models for individual loci. The trained CNN models are then
157 aggregated for different pairs of loci to generate a series of ensemble models to further improve
158 ploidy prediction accuracy. (B) A total of 646 samples were randomly split into training, validation,
159 and test datasets. The training dataset was used to learn the weights of the neural network
160 models. The validation dataset was used to select the hyperparameters specifying the CNN model
161 architecture. The test dataset (N = 66) was further divided into a calibration subset (N = 32) and
162 a final held-out test subset (N = 34; see Methods), and was never used during model training. (C)
163 Bioinformatic pipeline for processing raw target capture reads. For each sample and each locus,
164 only the 350 reads with the fewest gaps after alignment were retained. (D) Ploidy prediction model
165 architecture. The input to the model consists of aligned target capture reads for a given locus.
166 The input is then passed through several convolutional layers, and the output is passed through
167 several fully connected layers to predict the probability that the sample is diploid or polyploid.
168 We first trained convolutional network (CNN) models, each based on the training data for


169 a single locus. To improve predictive performance, pairs of locus-specific CNN models were later


170 combined into ensemble models, retrained using the same training/validation framework and


171 evaluated on the same independent test set, which was not used during model selection. We also


172 similarly developed and tested a random forest model that uses all of the loci.


173 **Sequence alignment and preprocessing**


174 For each sample we generated binary alignment map (BAM) files that map the sequence


175 reads from the GoFlag targeted capture sequence datasets to reference sequences for each


176 locus. First, we trimmed the FASTQ files with paired end raw sequence reads using Trim Galore


177 &#91;(https://github.com/FelixKrueger/TrimGalore),&#93;(https://github.com/FelixKrueger/TrimGalore) which removes adapters and low-quality


178 sequences. We then assembled sequences for each locus targeted by the GoFlag probe set using


179 the pipeline described in Breinholt et al. (2021). In cases in which the GoFlag pipeline produced


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 7


180 more than one sequence per locus, we chose as the reference the longest sequence, or the first


181 sequence output if they are of equal length. Next, we mapped the trimmed paired end reads to


182 the reference sequences for each locus using the Burrows-Wheeler Aligner (BWA; Li and Durbin,


183 2009), which outputs the alignment in a sequence alignment map (SAM) file. We then used


184 SAMtools v1.3.1 (Li et al., 2009) to convert the SAM files into compressed BAM files. These are


185 the same initial steps used to prepare data for analyses with nQuire (Viruel et al., 2023).


186 BAM files were processed into a standardized alignment format for CNN training (Figure


187 1C; Supplemental Figure 1). For each sample and locus, reads were converted from BAM to


188 FASTA format. We used pysam (v0.9.1) for BAM processing, with SAMtools v1.3.1 (Li et al.,


189 2009) as a fallback when needed. Read alignments were generated with MAFFT v7.520 (Katoh


190 and Standley, 2013) unless alignment was explicitly skipped in accelerated runs. To standardize


191 alignment structure, we removed internal gap columns — alignment columns corresponding to


192 gap positions in the reference sequence, excluding its first and last positions — from all


193 sequences, and separately trimmed all sequences to the window defined by the leading and


194 trailing gap positions of the reference sequence. Both steps were keyed to the reference


195 sequence rather than a percentage-based gap threshold across all reads. The retained gap


196 characters therefore represent alignment gaps (indel-related positions) in the processed multiple

197 sequence alignments.


198 To construct fixed-size model inputs, we retained up to 350 reads per locus for each


199 sample. When more than 350 reads were available, we selected the 350 reads with the fewest


200 gap characters and ordered them by ascending gap count (fewest gaps first); when 350 or fewer


201 reads were available, all reads were retained in their original order from the assembled FASTA


202 file. When fewer than 350 reads were available, the remaining rows were padded with entire rows


203 of the gap token so that each locus had the same read-depth dimension (350 reads plus the


204 reference). Nucleotides were then numerically encoded using a fixed tokenization scheme (A =


205 1, C = 2, G = 3, T = 4, gap/other = 0). Each sequence — reference and reads alike — was


206 standardized to a fixed length of 154 nucleotide positions, near the mean length of the recovered


207 locus sequences (144.6 bp), by truncating sequences longer than 154 positions (retaining the first


208 154 positions) and right-padding shorter sequences with the gap token. This produced final


209 tensors of 351 sequences (1 reference + 350 reads) × 154 positions per locus per sample.


210 **CNN model architecture and training**


211 Samples were partitioned into four non-overlapping subsets: training (N = 516), model

212 selection validation (N = 64), held-out calibration (N = 32), and final test (N = 34). The training set


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 8


213 was used to fit model parameters. The model-selection validation set was used during


214 development for hyperparameter optimization. After hyperparameters were fixed, the held-out


215 calibration set—kept fully separate from model fitting and hyperparameter tuning—was used for


216 post-selection checks (e.g., threshold and probability-calibration behavior) before final reporting.


217 The final test set was reserved for independent performance evaluation and was not used for


218 model fitting, hyperparameter selection, or threshold tuning. In analyses requiring a larger held

219 out cohort, we additionally report results on the combined held-out set (held-out calibration + final


220 test; N = 66).


221 For each locus, we trained a separate convolutional neural network (CNN) to classify


222 samples as diploid or polyploid using aligned, tokenized read matrices (Figure 1D; Supplemental


223 Figure 2). We did not attempt to distinguish among different polyploidy levels (e.g., triploid,


224 tetraploid, hexaploid) due to the limited size of our training set. Locus-specific CNNs followed a


225 LeNet-style architecture with 1–3 convolutional layers (16–32 filters; 3×3 or 4×4 kernels),


226 ReLU/LeakyReLU/ELU activations, max or average pooling, and two fully connected layers (64–


227 128 units) with shared dropout (0.1–0.3). A sigmoid output layer produced the predicted


228 probability of polyploidy.


229 Model parameters were trained using Adam optimizer (Kingmaand Ba, 2014) under binary


230 cross-entropy loss. Hyperparameters were selected independently for each locus using Optuna


231 (Akiba et al., 2019; 25 trials per locus). The full search space and selected values are reported in


232 Supplemental Table S1. The search space included architectural choices (number of


233 convolutional layers, filter configuration, kernel size, activation, pooling, and fully connected width)


234 and optimization parameters (learning rate: 10⁻⁵ to 10⁻³; weight decay: 10⁻⁵ to 10⁻³; epoch budget:


235 10–30). To improve robustness to read-order artifacts, the 350 non-reference reads were


236 randomly permuted at each training epoch while the reference row remained fixed. Final


237 performance was reported using accuracy and area under the receiver operating characteristic


238 curve (AUROC) on the independent final test set, with combined held-out analyses (N = 66)


239 reported where specified.


240 **Training models on pairs of loci (ensemble models)**


241 In addition to single-locus CNN models, we developed ensemble models that combine


242 information from pairs of loci to improve ploidy prediction (Figure 1A). We retained 384 loci as


243 candidates for downstream ensemble modeling after preprocessing and model-quality filtering.


244 Considering all pairwise combinations of these 384 loci would have required training and


245 evaluating 384 × 383 / 2 = 73,536 pair models. Thus, to keep this analysis computationally


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 9


246 tractable, we trained pair models for a subset of locus pairs and analyzed a random subsample


247 of 1,996 of these pair models. This subsample included every one of the 384 candidate loci at


248 least once (1–27 pairs per locus; mean = 10.4, median = 9), and per-locus representation was


249 independent of single-locus validation AUROC (Pearson r = 0.04, Spearman ρ = 0.05), indicating


250 that the sampled pairs were not biased toward higher- or lower-performing loci and instead


251 spanned the full range of individual locus quality (validation AUROC range: 0.573–0.960, mean =


252 0.811). This subsample allowed us to evaluate ensemble performance both for pairs of


253 individually strong loci and — as illustrated below — for pairs where one or both constituent loci


254 performed only moderately or near chance on their own.


255 Rather than combining the raw sequencing reads from two loci directly, each ensemble


256 model combines the internal, learned summary that each single-locus CNN model produces for


257 a sample — a compact numerical representation of the patterns that model uses to distinguish


258 diploids from polyploids — and uses this combined summary as input to a second-stage classifier


259 trained specifically on that pair of loci. Specifically, for each candidate locus, we extracted the


260 final hidden CNN representation (i.e., output by the layer immediately before the sigmoid


261 activation) and trained a locus-specific projection head to map this representation to a common


262 500-dimensional embedding. This was necessary because locus-specific CNN configurations can


263 produce representations of variable sizes due to different CNN model hyperparameters. Each


264 projection head consisted of an embedding block (a fully connected layer to 500 dimensions,


265 followed by ReLU activation and dropout &#91;p = 0.2&#93;) and a classifier block (fully connected layers


266 of 256 and 1 units, with ReLU activation and dropout &#91;p = 0.2&#93; on the first layer). The models were


267 trained with a binary cross-entropy loss (weighted by class imbalance). Projection heads were


268 trained independently for each of the 384 candidate loci, using AdamW (learning rate = 1×10⁻³,


269 weight decay = 1×10⁻⁴) for up to 200 epochs with early stopping (patience = 20 epochs) and a


270 batch size of 64.


271 For each pair of loci, we discarded the classifier block of each projection head and used


272 only its embedding block, so that each locus in the pair was represented by a 500-dimensional


273 embedding for each sample. The two embeddings were then concatenated into a single 1,000

274 dimensional feature vector, which served as the input to the pair-level classifiers. We evaluated


275 four classifier heads on these pair features, each with a fixed configuration rather than pair

276 specific hyperparameter tuning: logistic regression (L-BFGS solver, max_iter = 2000, with feature


277 scaling); support vector machine with a radial basis function kernel (C = 10, gamma = "scale",


278 with feature scaling); gradient boosting (300 estimators, learning rate = 0.05, max depth = 3); and


279 a multilayer perceptron (two hidden layers of 256 and 128 units, alpha = 1×10⁻³, initial learning


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 10


280 rate = 1×10⁻³, max_iter = 2000, with early stopping and feature scaling). For each pair, all four


281 heads were fit on the training split, and the best-performing head was selected by AUROC on the


282 model-selection validation split; that head was then refit on the combined train+validation data


283 and evaluated on the held-out calibration and final test sets. This procedure yielded 1,996 locus

284 pair model datapoints, with the best-performing head selected as logistic regression (n = 239),


285 SVM-RBF (n = 252), gradient boosting (n = 698), or MLP (n = 807) in different pairs.


286 All analyses were run on Linux with Python 3.9, using PyTorch for model


287 training/inference, Optuna for hyperparameter optimization, and scikit-learn for ensemble


288 classifiers. Runs used fixed random seeds and fixed data splits for reproducibility, with GPU when


289 available and CPU fallback otherwise. Training the reported pairwise models required


290 approximately 12.8 GPU-hours in total (mean 23.1 s per pair; range 3.5–72.2 s per pair).


291 **Random Forest (RF) model using all loci**


292 In addition to the CNN and ensemble models, we also developed an ad hoc Random


293 Forest (RF) model that aggregates signals across all available loci for each sample. This may be


294 useful in cases when single-locus CNN predictions are poorly calibrated for the samples or have


295 low individual accuracy. We trained the RF model using the original fern training data. Specifically,


296 each sample was represented using all available locus-level CNN probabilities for that sample


297 (i.e., no fixed locus panel was required per sample). From this per-sample probability profile, we


298 computed summary descriptors of signal strength and uncertainty, including central tendency


299 (average behavior), dispersion (spread across loci), confidence structure (how strongly


300 predictions deviate from 0.5), and entropy (overall prediction uncertainty). The RF model uses


301 these descriptors to produce a final ploidy probability, allowing each sample to contribute


302 evidence from all usable loci despite uneven locus recovery.


303 **Evaluation and Reproducibility**


304 For final classification, probabilities were converted to binary labels using predefined


305 thresholds (0.5 for CNN/ensemble/hybrid; fixed RF threshold from training-only calibration). We


306 compared this probability-averaging framework against alternative decision rules (including


307 majority voting) and retained probability averaging for CNN/ensemble/hybrid because it yielded


308 the best held-out performance in our comparisons. Performance of all CNN and ensemble models


309 was evaluated on the independent test set (19 diploids and 15 polyploids) using accuracy, defined


310 as the proportion of samples correctly classified, and the AUROC, which measures the ability to


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 11


311 distinguish diploids from polyploids across all possible classification thresholds. AUROC


312 complements accuracy by evaluating overall discriminatory ability independently of a single


313 classification threshold and is generally less sensitive to class imbalance.


314 **Comparison with Existing Ploidy-Inference Methods**


315 To benchmark performance, we compared our approach with nQuirev20180405 (Weiß et


316 al., 2018) and nQuack v1.0.0 (Gaynor et al., 2024), which we applied to the same sequence data


317 from the 646 samples. For nQuire, analyses were run with and without de-noising, and ploidy was


318 inferred from the model with the lowest Δlog-likelihood relative to the free model. Diagnostic


319 metrics such as sum of squared residuals (SSR), regression slope, and R² were used to assess


320 fit quality. For nQuack, we followed the published tutorial, evaluating 18 model configurations


321 spanning six probability distributions and three mixture model types. Both nQuire and nQuack


322 estimate the ploidy level of polyploids, but for our comparisons we only considered if the result


323 was diploid or polyploid.


324 We also phased the reads from all of the samples using PATÉ (Tileyet al., 2024) to


325 determine if the estimated proportion of variable loci or overall heterozygosity of each sample


326 could be used to distinguish between diploids and polyploids. PATÉ requires an input file that has


327 the ploidy for all samples and limits the number of possible alleles. We ran PATÉ on all samples


328 assuming that they were all diploid, which is a reasonable strategy if the ploidy levels were


329 unknown. We used the same reference sequences from each locus that we used to generate the


330 original BAM files.


331 **Exploratory analyses of trained CNN models**


332 A key distinction between our CNN framework and allele-frequency methods (e.g., nQuire


333 and nQuack) is that CNNs can leverage inter-site covariation via convolutional filters and


334 nonlinear layers. To test whether our models have learned to exploit this information, we applied


335 three shuffling perturbations to reads from a held-out evaluation set of 66 samples (32 calibration


336 samples plus 34 test samples): (1) global row shuffling, in which rows in the read alignments were


337 permuted consistently across columns, preserving per-read composition while perturbing row

338 wise structure relative to the reference; (2) column shuffling, in which alignment columns were


339 permuted as intact units, disrupting positional order while preserving within-column nucleotide


340 composition; and (3) independent within-column row shuffling, in which the nucleotides were


341 shuffled independently within each column, preserving per-column allele frequencies while


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 12


342 disrupting covariation across positions (Figure 4A). We applied these perturbations to test data


343 for the top 100 individual single-locus CNN models and the top 100 ensemble pair models. For


344 each model and each perturbation, shuffled-input performance was compared with unshuffled

345 input performance on the same held-out samples. Performance declines under these


346 perturbations provide evidence that predictions depend on aspects of alignment structure beyond


347 the marginal per-site nucleotide or allele-frequency distributions preserved by all three shuffling


348 procedures.


349 **Correlational study between model performance and data features**


350 To evaluate how properties of the input-alignment relate to model performance, we tested


351 associations between per-locus test AUROC and summary statistics computed from the multiple

352 sequence alignments used to train each of the 384 locus-specific CNN models. For each locus,


353 we computed three metrics: (1) gap fraction, the proportion of gap characters across all alignment


354 cells (reads × positions); (2) variant density, the proportion of alignment columns with more than


355 one observed nucleotide state after excluding gaps; and (3) mean Shannon entropy, the average


356 per-column entropy across alignment positions, where larger values indicate greater within

357 column nucleotide diversity averaged across positions. We then quantified associations between


358 each metric and test AUROC across loci using both Pearson and Spearman rank correlation.


359 **Effect of read depth on accuracy of CNN and RF models**


360 To assess the sensitivity of our models to sequencing depth and determine how reduced


361 read coverage affects predictive performance, we evaluated both single-locus CNN and RF


362 models using the same depth-reduction procedure. Specifically, for each sample and depth


363 fraction (1, 1/2, 1/4, 1/8, 1/16, and 1/32 of full depth), the reference sequence was retained, non

364 reference reads were randomly subsampled without replacement to the target depth, and the


365 retained non-reference reads were randomly permuted to minimize order-dependent bias; four


366 replicate resamples were generated per depth fraction using fixed random seeds.


367 For the CNN model analysis, we applied this procedure to the 10 top-performing CNN


368 locus models, evaluating each fixed, pretrained model directly on the depth-reduced reads from


369 the held-out N=34 test set without retraining. For the RF analysis, we applied the same depth

370 reduction procedure across all available loci, recomputed each locus’ CNN probability from the


371 depth-reduced reads, transformed these into the RF model’s feature set, and passed them


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 13


372 through the fixed, pretrained RF bundle. In both cases, performance at each depth fraction was


373 summarized as the mean ± SD across the four replicates for test accuracy and AUROC.


374 **Application to an independent dataset (** _**Lygodium)**_


375 To evaluate the models on fern samples not represented in model training, we applied our


376 trained model with frozen weights to a published dataset of target-capture samples from 35


377 species of _Lygodium_ (Lygodiaceae), generated with the GoFlag 408 probe set (Pelosi et al.,


378 2024). The GoFlag probes recovered an average of only 266 loci per sample, compared to an


379 average of 371 loci for all training set samples, therefore representing a challenging real-world


380 dataset. This dataset included 60 samples from 18 species that had ploidy annotations based on


381 chromosome counts and were not included in the original training set used to develop the ML


382 models. Among these samples, 41 were diploid and 19 were tetraploid. Within the tetraploid


383 subset, 10 samples were classified as likely autotetraploid ( _L. flexuosum_, _L. japonicum_, and _L._


384 _longifolium_ ) and 6 as allotetraploid ( _L. cubense_, _L. heterodoxum_, and _L. oligostachyum_ ). The


385 remaining samples from this study had ambiguous (e.g., multiple cytotypes) or missing ploidy


386 annotations and were not included in supervised accuracy/AUROC analyses.


387 We used four strategies to predict ploidy in the _Lygodium_ samples. First, we applied the


388 ten highest-ranked single-locus CNN models to each sample. Second, we applied five top-ranked


389 locus-pair ensemble models (loci 146+389, 146+320, 139+146, 16+342, and 158+373), each with


390 its selected classification head (SVM-RBF for four pairs and MLP for 139+146). Third, we


391 evaluated a hybrid strategy that combines the single-locus CNN models with a locus-pair


392 ensemble model. For a given sample, the hybrid probability of polyploidy was calculated as the


393 mean of two components: the predicted probabilities from the 10 single-locus CNN models and


394 the predicted probability from one locus-pair ensemble model. Because this second component


395 depends on which ensemble pair is chosen, the hybrid probability is not a single fixed value — it


396 changes depending on which locus pair is included. To illustrate this, we computed the hybrid


397 probability separately using each of the five top-ranked locus-pair ensemble models described


398 above, producing five hybrid predictions per sample rather than one. This allowed us to directly


399 compare how the choice of ensemble pair influences the combined CNN + ensemble prediction.


400 Finally, we also used the ad hoc Random Forest (RF) model that aggregates signals across all


401 available loci for each sample.


402 To examine whether model performance differs between autopolyploid and allopolyploid


403 samples, we subset the _Lygodium_ validation samples into two comparisons — autotetraploid vs.


404 diploid and allotetraploid vs. diploid — using the classifications of Pelosi et al. (2024). For each


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 14


405 comparison and each model type (CNN, ensemble, hybrid, and RF), we performed 5,000 non

406 stratified bootstrap resamples, sampling individual samples with replacement from the combined


407 diploid and polyploid-subtype subset. For each resample, we computed accuracy (at the 0.5


408 classification threshold) and AUROC; bootstrap draws containing samples from only one class


409 were discarded from the AUROC calculation, as AUROC is undefined in that case. Reported


410 accuracy and AUROC values are the mean of the bootstrap distribution, and 95% confidence


411 intervals were calculated as the 2.5th and 97.5th percentiles of that distribution.

## 412 RESULTS


413 **Model Performance of CNN individual locus-based models**


414 We evaluated all 384 locus-specific CNN models on the held-out test set (N = 34; Figure


415 2, Supplemental Table S1). Across models, the mean accuracy was 0.641 ± 0.067 (mean ± SD;


416 Figure 2A), and the mean AUROC was 0.729 ± 0.071 (Figure 2B). The model based on locus 238


417 achieved the highest AUROC (0.923; accuracy = 0.824; Figure 2C).


418 **Ensemble Model Performance**


419 To determine whether integrating information across loci improves ploidy prediction, we


420 trained and evaluated ensemble models on pairs of loci using four classification heads (logistic


421 regression, SVM-RBF, gradient boosting, and MLP; see Methods). In total, we evaluated 1,996


422 locus-pair model configurations. Among the 1,996 analyzed pairs, the best-performing model with


423 respect to AUROC combined loci 146 and 313 with an MLP head and achieved an AUROC of


424 0.993 and an accuracy of 0.912 on the held-out 34-sample test set. To illustrate the magnitude of


425 the ensemble effect even when constituent loci are individually weak, Figure 3A and B compares


426 a representative ensemble model (loci 15 and 350, gradient boosting head; accuracy = 0.941,


427 AUROC = 0.963) to its two constituentsingle-locus CNN models (locus 15: accuracy = 0.706,


428 AUROC = 0.793; locus 350: accuracy = 0.588, AUROC = 0.740) and to the best single-locus CNN


429 model overall (locus 238: accuracy = 0.824, AUROC = 0.923). Although neither locus 15 nor locus


430 350 performs well individually, and locus 350 in particular has an accuracy only modestly above


431 random chance, their combination substantially outperformed both constituents and even the best


432 individual CNN locus. To assess this pattern across all 1,996 evaluated configurations, we


433 compared the performance of each locus-pair ensemble to the stronger of its two constituent


434 single-locus models (Figure 3C, D). Across all four classifier heads (logistic regression, n = 239;


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 15


435 SVM-RBF, n = 252; gradient boosting, n = 698; MLP, n = 807), a large majority of locus-pair


436 models fell above the y = x reference line for both accuracy and AUROC, indicating that most


437 ensembles outperformed the best of their two constituent loci. Across all 1,996 locus pairs,


438 92.33% of points in the accuracy panel and 93.74% of points in the AUROC panel lie above the


439 identity line. This pattern was consistent across classifier types, suggesting that integrating


440 information across loci captures complementary discriminatory signals not available from either


441 locus alone, regardless of which classification head is used to combine them.


442
443 **Figure 2. Distribution of performance metrics across all 384 individual CNN locus models**
444 **evaluated on an independent test set of 34 samples (19 diploid and 15 polyploid).** (A)
445 Histogram of test accuracy across all single-locus CNN models; each bar corresponds to one
446 possible accuracy value on the 34-sample test set (k/34). The red dashed line indicates the
447 majority-class baseline (0.559, the proportion of diploid samples), and the dark red and teal
448 dashed lines indicate the accuracy of nQuire (0.500) and nQuack (0.618), respectively. (B)
449 Histogram of test AUROC across all single-locus CNN models; the red dashed line indicates
450 random classification performance (0.50). In (A) and (B), solid blue lines indicate the mean across
451 loci. (C) Confusion matrices for the best-performing single-locus CNN model (L238), nQuire, and
452 nQuack on the 34-sample test set. Across all loci, the mean test AUROC was 0.729 ± 0.071 and
453 the mean test accuracy was 0.641 ± 0.067 (mean ± SD). The best-performing model (L238)
454 achieved a test accuracy of 0.824 and an AUROC of 0.923.


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 16


455 **Random Forest Model Performance**


456 For comparison, we also evaluated the RF model on the original 34-sample held-out test


457 set, where it achieved an accuracy of 0.765 (26 of 34 samples correctly classified) and an AUROC


458 of 0.870. This is higher than the average single-locus CNN model (accuracy = 0.641, AUROC =


459 0.729) but lower than the best-performing single-locus CNN model (accuracy = 0.824, AUROC =


460 0.923).


461
462 **Figure 3. Ensemble models outperform individual single-locus CNN models on the**
463 **independent test set.** (A, B) Comparison of test AUROC (A) and test accuracy (B) for a
464 representative ensemble model (loci L15 and L350, gradient boosting head) against its two
465 constituent single-locus CNN models and the best-performing single-locus CNN model overall
466 (L238). This pair illustrates that a moderately performing locus (L15: AUROC = 0.793, accuracy
467 = 0.706) combined with a weaker locus (L350: AUROC = 0.740, accuracy = 0.588) can yield an
468 ensemble (AUROC = 0.963, accuracy = 0.941) that substantially outperforms both constituents
469 and exceeds even the best individual locus model (L238: AUROC = 0.923, accuracy = 0.824).
470 Red dashed lines indicate random classification performance (0.50). (C, D) Scatter plots
471 comparing the AUROC (C) and accuracy (D) of each of 1,996 locus-pair ensemble models (y472 axis) to the better-performing of its two constituent single-locus CNN models (x-axis), across four
473 classification heads: logistic regression (n = 239), SVM-RBF (n = 252), gradient boosting (n =
474 698), and MLP (n = 807). Points above the diagonal indicate ensembles that outperform the
475 stronger of their two constituent loci. Across all 1,996 locus pairs, 92.33% of points in the accuracy


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 17


476 panel (D) and 93.74% of points in the AUROC panel (C) lie above the identity line, indicating that
477 ensemble performance exceeds the single-locus baseline for the large majority of pairs.


478 **Comparison with Other Methods**


479 To benchmark our approach against existing ploidy-inference methods, we applied nQuire


480 (Weiß et al., 2018) and nQuack (Gaynor et al., 2024) to the same 34 independent test samples


481 used above. For nQuire, we used the `lrdmodel` output and assigned each sample to the ploidy


482 class—diploid, triploid, or tetraploid—with the lowest Δlog-likelihood relative to the free model,


483 following the authors’ recommendations. We performed this analysis using both full and denoised


484 BAM files. Both input types yielded an accuracy of 50.0% (17 of 34 samples correctly classified


485 as diploid or polyploid; Figure 2A, C). We also examined nQuire fit diagnostics (sum of squared


486 residuals &#91;SSR&#93;, regression slope, standard error, and R²). Only six samples received the same


487 ploidy call across all four diagnostics. SSR and slope showed the lowest overall accuracy (both


488 41.18%) but with opposite biases: SSR classified most samples as polyploid (sensitivity, the


489 proportion of polyploids correctly identified: 80.00%; specificity, the proportion of diploids correctly


490 identified: 10.53%), whereas slope favored diploid calls (sensitivity 26.67%, specificity 52.63%).


491 Standard error and R² performed somewhat better (both 58.82%), but standard error classified


492 nearly all samples as diploid (sensitivity 6.67%, specificity 100%), whereas R² was more balanced


493 (sensitivity 53.33%, specificity 63.16%).


494 For nQuack, we evaluated the 18 model combinations recommended in the published


495 workflow. For each sample and configuration, the predicted ploidy was taken as the class with


496 the lowest ΔBIC. Correct classifications ranged from 15 to 21 of 34 samples (44.12%–61.76%).


497 The best-performing configuration (normal-uniform, fixed_2, where only variance is free) achieved


498 61.76% accuracy (Figure 2A), outperforming nQuire on this test set. However, this model showed


499 a strong diploid bias: it correctly classified 18 of 19 diploid samples (94.74% specificity) but only


500 3 of 15 polyploid samples (20.0% sensitivity), indicating that its overall accuracy advantage over


501 nQuire reflects better performance on diploids rather than reliable polyploidy detection.


502 Additionally, phasing-based summaries from PATÉ indicated that, on average, polyploid


503 samples had higher heterozygosity, a higher proportion of variable loci, and a higher proportion


504 of phased loci than diploid samples (Supplemental Figure 7). However, these distributions


505 overlapped substantially (Supplemental Figure 7), indicating that these summary statistics alone


506 are not sufficient as standalone ploidy diagnostics.


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 18


507 **Single-locus CNN models rely on positional structure, while ensemble models**


508 **additionally rely on inter-site covariation**


509 We applied the three shuffling perturbations (see ‘Exploratory analyses of trained CNN


510 models’ in Methods) to the top 100 individual CNN locus models: global row shuffling (disrupting


511 row-wise structure), column shuffling (disrupting positional order), and independent within-column


512 row shuffling (disrupting inter-site covariation while preserving per-column allele frequencies;


513 Figure 4A).


514
515 **Figure 4. Models rely on positional structure, and ensemble models additionally capture**
516 **inter-site covariation.** (A) Schematic of the independent within-column row shuffling procedure:
517 nucleotides within each alignment column are shuffled independently across reads, preserving
518 per-position (per-column) allele frequencies while destroying covariation between positions. **(B)**
519 Comparison of model performance (AUROC) before and after each of three shuffling
520 perturbations — global row shuffling (left), column shuffling (middle), and independent within521 column row shuffling (right, corresponding to the schematic in A) — applied to held-out reads from
522 a 66-sample evaluation set (32 calibration + 34 test samples). Top row: the top 100 individual
523 single-locus CNN models. Bottom row: the top 100 ensemble pair models. Points falling below
524 the diagonal indicate reduced performance after shuffling relative to the unshuffled control. Across
525 both single-locus and ensemble models, column shuffling produced the largest performance
526 decline, indicating strong dependence on positional order; ensemble models additionally showed
527 substantial degradation under within-column row shuffling, indicating reliance on inter-site
528 covariation not evident in single-locus models.
529 Performance of the CNN models was largely unaffected by row shuffling (mean accuracy


530 change: −0.004; mean AUROC change: +0.008), but substantially degraded by column shuffling


531 (mean accuracy drop: 0.150; mean AUROC drop: 0.270) (Figure 4B, top row), indicating that the


532 single-locus models depend heavily on the positional identity of alignment columns while


533 remaining insensitive to the order in which reads are presented, consistent with the random per

534 epoch read permutation used during training (see Methods). Notably, we also observed a


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 19


535 moderate drop in model performance (mean accuracy drop: 0.014; mean AUROC drop: 0.031)


536 when rows were shuffled independently within each column, which disrupts the covariation


537 between positions. A subset of locus models wereinsensitive to this procedure, but others suffered


538 a performance drop of up to 10% in AUROC — evidence that at least some of the CNN models


539 have learned to exploit covariation between positions when making predictions.


540 We then applied the same procedures to the top 100 ensemble pair models. Unlike the


541 single-locus models, the ensemble models showed a drop in performance under row shuffling


542 (mean AUROC dropped by 0.157), indicating that these models rely on the ordering of sequencing


543 reads for prediction. This behavior is expected as the ensemble models were trained on the


544 concatenated read embeddings of the two loci calculated based on fixed read ordering, instead


545 of shuffled reads like the CNN models. Therefore, future applications should retain the existing


546 procedure of ordering reads by ascending gap count (fewest gaps first) to ensure high prediction


547 performance. Column shuffling produced an even larger drop in performance than for the single

548 locus models (mean AUROC dropped by 0.402). Finally, the performance drop under


549 independent row shuffling was more pronounced for the ensemble models (AUROC drop =


550 0.197), suggesting that these models rely more meaningfully on covariation between nucleotide


551 positions in addition to positional structure.


552 **Characteristics of loci influencing CNN prediction performance**


553 To examine how sequence characteristics influence CNN model behavior, we quantified


554 associations between locus-level performance and alignment-derived features across all 384 loci


555 (Figure 5). Across the 384 loci, gap fraction showed the strongest relationship with AUROC


556 (Figure 5A; Pearson r = −0.41, p &lt; 1×10⁻⁴; Spearman ρ = −0.36, p &lt; 1×10⁻⁴), indicating that


557 alignment gaps substantially reduce discriminatory performance. Variant density showed


558 inconsistent evidence of association with AUROC (Figure 5B): the Pearson correlation was weak


559 but statistically significant (r = 0.17, p = 0.00113), while the corresponding Spearman rank


560 correlation was weak, negative, and not statistically significant (ρ = −0.06, p = 0.238), indicating


561 no robust monotonic relationship between variant density and AUROC. Mean per-position


562 Shannon entropy — a measure of how evenly nucleotides are distributed across the four possible


563 bases at a given alignment column, with higher values indicating greater local sequence diversity


564 among the aligned reads, similarly showed inconsistent evidence of association with AUROC


565 (Figure 5C): the Pearson correlation was weak and not statistically significant (r = −0.10, p =


566 0.0608), while the Spearman rank correlation was weak, negative, and nominally significant (ρ =


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 20


567 −0.12, p = 0.0144), providing only marginal support for a negative association between local


568 sequence diversity and prediction performance.


569
570 **Figure 5. Factors associated with CNN model prediction performance across loci.** (A)
571 Relationship between test AUROC and gap fraction across all 384 single-locus CNN models.
572 Higher gap proportions in the input alignment were associated with lower prediction performance
573 (Pearson r = −0.41; Spearman ρ = −0.36; both p &lt; 10⁻⁴), consistent with missing data reducing
574 model accuracy. (B) Relationship between test AUROC and variant density. Variant density
575 showed a weak positive linear association with AUROC (Pearson r = 0.17, p = 0.001) that was
576 not supported by rank correlation (Spearman ρ = −0.06, p = 0.24), suggesting this association is
577 driven by a small number of low-density loci. (C) Relationship between test AUROC and average
578 per-position Shannon entropy. Higher entropy values were weakly associated with lower AUROC
579 (Spearman ρ = −0.12, p = 0.014; Pearson r = −0.10, p = 0.061). Red dashed lines indicate linear
580 regression fits, and inset statistics report Pearson correlation coefficients (r) and Spearman rank
581 correlations (ρ) with associated p-values.


582 **Effect of read depth on performance**


583 To assess the effect of sequencing depth on model performance, we evaluated a subset


584 of the 10 top-performing CNN locus models across a range of downsampled read depths (from


585 full depth down to 1/32 of full depth; Supplemental Figure 3). Averaged across these 10 loci, mean


586 AUROC decreased from 0.880 at full depth to 0.796 at 1/32 of full depth, and mean accuracy


587 decreased from 0.747 to 0.699 over the same range. An initial decline between full and half depth


588 was followed by a plateau across the intermediate depth fractions (1/2 through 1/16), with the


589 largest single-step decline occurring only at the most extreme reduction tested (1/16 to 1/32 of


590 full depth). Even at this lowest depth, mean performance remained well above the random

591 classification baseline (AUROC and accuracy of 0.5), indicating that single-locus CNN models


592 remain informative under substantially reduced sequencing depth.


593 The RF model showed a different pattern across the same depth range (Supplemental


594 Figure 3C). Rather than declining steadily with depth, RF accuracy and AUROC fluctuated within


595 a comparatively narrow band: accuracy ranged from 0.706 to 0.765 and AUROC ranged from


596 0.749 to 0.870 across all depth fractions tested, with the lowest values occurring at intermediate


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 21


597 depths (1/8 for accuracy, 1/16 for AUROC) rather than at the lowest depth evaluated. At 1/32 of


598 full depth, RF accuracy (0.743) and AUROC (0.830) were close to their full-depth values (0.765


599 and 0.870, respectively), indicating that RF performance is comparatively insensitive to


600 sequencing depth across the range tested. More broadly, these results suggest that a smaller


601 number of high-quality target-capture reads may be sufficient to achieve reasonable predictive


602 performance, particularly when locus-level predictions are aggregated by the RF model.


603 **Model validation on** _**Lygodium**_ **dataset**


604 To evaluate performance on a separate empirical dataset, we applied the previously


605 trained models to 60 _Lygodium_ samples with ploidy determinations based on chromosome counts


606 (see Methods). Identities and per-model performance of the specific loci and locus pairs evaluated


607 are provided in Supplemental Figure 4.


608 Across the top-performing models of each type, single-locus CNN models showed the


609 lowest performance (AUROC range: 0.32–0.59, mean = 0.51 ± 0.10; accuracy range: 0.41–0.67,


610 mean = 0.56 ± 0.09). Ensemble models achieved higher AUROC (AUROC range: 0.42–0.74,


611 mean = 0.58 ± 0.14; accuracy range: 0.48–0.58, mean = 0.54 ± 0.04), and hybrid models


612 performed comparably to ensemble models (AUROC range: 0.42–0.74, mean = 0.59 ± 0.14;


613 accuracy range: 0.43–0.59, mean = 0.53 ± 0.07) (Figure 6A, B). However, the newly trained


614 random forest model, which summarizes CNN probabilities across all available loci per sample,


615 outperformed all other approaches (accuracy = 0.782, AUROC = 0.781; 55 labeled samples, 91


616 samples with usable feature profiles), indicating that aggregating complementary signal across a


617 larger number of loci can further improve cross-taxon generalization beyond pairwise ensembling


618 alone. For comparison, nQuire achieved an accuracy of only 0.281 (full) and 0.263 (denoised) on


619 the _Lygodium_ dataset, performing well below chance, while nQuack achieved an accuracy of


620 0.643, below both the random forest and the best individual CNN models. The relatively strong


621 performance of nQuack was greatly influenced by the high proportion of diploids in the _Lygodium_


622 dataset as it again appears to have difficulty identifying polyploids.


623 To better understand the differences in classification performance among model types,


624 we examined their predicted-probability distributions relative to the 0.5 decision threshold


625 (Supplemental Figure 5; n = 53 CNN, n = 48 ensemble, and n = 47 hybrid per-sample predictions).


626 For each sample, we averaged the probabilities from the top-performing CNN models (up to 10)


627 and from the top-performing ensemble pairs (up to 5), and computed a hybrid value as the


628 average of these two per-sample means. The CNN predictions were concentrated below 0.5 (i.e.,


629 toward diploid), with only 3.8% of per-sample mean probabilities exceeding 0.5, despite an


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 22


630 observed polyploid prevalence of 34.0%. This suggests that the single-locus CNN models tended


631 to classify _Lygodium_ samples as diploid, potentially reflecting poor probability calibration on this


632 dataset. In contrast, ensemble predictions were more dispersed and frequently exceeded the


633 classification threshold, with 56.2% of per-sample mean probabilities above 0.5 against an


634 observed prevalence of 31.2%. The hybrid values produced the most balanced threshold


635 behavior, with 29.8% exceeding 0.5, closely matching the observed polyploid prevalence of


636 31.9%. These results suggest that combining CNN and ensemble predictions may partially offset


637 their opposing biases, bringing the proportion of polyploid calls closer to the observed prevalence.


638
639 **Figure 6. Generalization of trained models to the independent** _**Lygodium**_ **dataset.** (A)
640 Classification accuracy and (B) AUROC of the top-performing single-locus CNN (n = 10 for
641 accuracy, n = 9 for AUROC), ensemble (n = 5), and hybrid (n = 5) models applied to 60 _Lygodium_
642 samples with known ploidy; because locus recovery varied among samples, not every model
643 could be evaluated on all 60 samples. CNN models are shown in blue, ensemble models in
644 orange, and hybrid models in green; points show individual models. The purple diamond indicates
645 the random forest (RF) model, which aggregates locus-level CNN probabilities across all available
646 loci per sample (accuracy = 0.782, AUROC = 0.781). The red dashed line indicates random
647 classification performance (0.50); in (A), the green dashed and purple dotted lines indicate the
648 accuracy of nQuire applied to full (undenoised) read data (0.281) and nQuack (0.643),
649 respectively. One CNN model (L138) could be evaluated on only three samples and lacks an
650 AUROC because all three were diploid. Ensemble and hybrid models generally achieved higher
651 AUROC than single-locus CNN models, and the RF model outperformed all other approaches,
652 suggesting that aggregating predictions across many loci improves robustness.


653 **Autopolyploid vs allopolyploid**


654 Finally, we examined whether our trained models exhibit distinct prediction performance


655 when applied to autopolyploid versus allopolyploid samples, by subsetting the _Lygodium_ dataset


656 into autotetraploid vs. diploid and allotetraploid vs. diploid comparisons, based on the


657 classifications made by Pelosi et al. (2024) using phylogenomic approaches. In both comparisons,


658 diploid samples substantially outnumbered the tetraploid subset, which would artificially inflate the


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 23


659 accuracy of a model that simply predicted "diploid" for every sample, independent of any genuine


660 discriminative ability. For example, a naive classifier that always predicted "diploid" — regardless


661 of model output — would achieve 79.5–80.5% accuracy on the autotetraploid vs. diploid


662 comparison and 85.4–86.8% accuracy on the allotetraploid vs. diploid comparison. These ranges


663 reflect the slightly different sample sizes available to the CNN, ensemble, hybrid, and RF models


664 due to differing per-sample locus coverage, not a difference in model performance. We report


665 bootstrap accuracy (see Methods) for each model type in Supplemental Figure 6A, B for


666 completeness. Notably, observed accuracy fell below this naive baseline for all deep-learning


667 model types in both comparisons (CNN: 0.751 and 0.805; ensemble: 0.465 and 0.554; hybrid:


668 0.652 and 0.703, for autotetraploid and allotetraploid discrimination, respectively), confirming that


669 these naive baselines are already high without reflecting any real discrimination. The RF model


670 achieved accuracy of 0.779 and 0.857 for autotetraploid and allotetraploid discrimination,


671 respectively — approaching the naive baselines but still reflecting genuine discrimination as


672 confirmed by AUROC. We therefore treat AUROC — which is threshold-independent and not


673 biased by class imbalance — as the primary metric for this comparison (Supplemental Figure 6C,


674 D).


675 Bootstrap-aggregated CNN AUROC was higher for autotetraploid vs. diploid


676 discrimination (0.657; 95% CI: 0.47–0.83) than for allotetraploid vs. diploid discrimination (0.372;


677 95% CI: 0.13–0.63); the point estimate for allotetraploid discrimination fell below the random

678 classification value of 0.5, suggesting that single-locus CNN models do not reliably distinguish


679 allotetraploids from diploids. Ensemble models showed the opposite pattern, with higher AUROC


680 for allotetraploids (0.722; 95% CI: 0.51–0.92) than for autotetraploids (0.361; 95% CI: 0.11–0.63).


681 The hybrid approach followed the same direction as the ensemble models, with higher AUROC


682 for allotetraploids (0.675; 95% CI: 0.45–0.87) than for autotetraploids (0.400; 95% CI: 0.15–0.66).


683 In contrast, the RF model achieved the highest AUROC of any method for allotetraploid


684 discrimination (0.856; 95% CI: 0.69–0.98) and matched CNN performance for autotetraploid


685 discrimination (0.671; 95% CI: 0.47–0.85), making it the most consistent model type across both


686 subgroups. Because these comparisons include only 10 autotetraploid and 6 allotetraploid


687 samples, the confidence intervals are wide and overlap between subgroups, and these


688 differences should be interpreted with caution.


689 These contrasting patterns raise the possibility that CNN and ensemble models capture


690 different aspects of the ploidy signal: individual CNN models, which rely on single-locus read


691 patterns, may be more sensitive to the dosage effects characteristic of autopolyploidy, while


692 ensemble models, which integrate information across locus pairs, may be better suited to


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 24


693 detecting the inter-locus divergence patterns associated with allopolyploidy. The RF model, which


694 aggregates CNN predictions across all available loci, may combine both signals. Testing these


695 hypotheses will require larger samples of autopolyploids and allopolyploids with known origins.

## 696 DISCUSSION


697 **Performance of sorAI**


698 The sorAI machine learning modelling approaches infer polyploidy from GoFlag targeted


699 capture data of ferns with a degree of accuracy that surpasses that of more general statistical


700 approaches like nQuire (Weiß et al., 2018) or nQuack (Gaynor et al., 2024). Perhaps more


701 importantly, rather than simply being a black box to infer ploidy from complex, previously


702 undetected patterns, we demonstrate how ML approaches can be used to provide insights into


703 the data features most important for determining ploidy and the potential shortcomings of other


704 approaches to infer ploidy from HTS data.


705 There appear to be some broad associations with ploidy level across all the loci. For


706 example, polyploids tend to have higher overall heterozygosity across all loci than diploids


707 (Supplemental Figure 7). However, these associations are not clear or distinct enough to make


708 them reliably diagnostic about ploidy level. While the ML models leverage targeted capture and


709 chromosome count data from hundreds of fern specimens to build the training set, the CNN


710 models demonstrate that it is possible to infer ploidy with high accuracy from even a single locus


711 (Figure 2A). This is reminiscent of early molecular approaches that determined ploidy in ferns


712 using allozymes or few loci (e.g., Haufler, 1985). Yet there is high variance in the performance of


713 CNN models among loci; in fact, models developed from many loci are no better, and occasionally


714 worse, than random guesses (Figure 2). This suggests that focusing on the most informative loci


715 may provide more clarity than summarizing patterns from all loci. Our ML models provide such an


716 approach to highlight these most informative loci.


717 Although the single-locus CNN models often perform well, in some cases, their


718 performance may falter. For example, CNN models appear to have decreased accuracy when


719 sequence coverage or data quality is lower, as seen in the experiments decreasing the


720 sequencing depth (Supplemental Figure 3) or in the analyses of the _Lygodium_ dataset, in which


721 there was below average recovery of loci from GoFlag probe set (Figure 6). The performance of


722 the ensemble models and the Random Forest model show that adding information from multiple


723 loci may improve upon and provide more robust estimates of ploidy than the single locus CNN


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 25


724 models. In most cases we examined (more than 92% of locus pairs), the ploidy estimates from


725 the two-locus ensemble models improve upon the estimates of the single-locus CNN models


726 using their constituent loci (Figure 3). The RF models maintain an accuracy of approximately 71–


727 78% on the original test set (76.5%), in the difficult Lygodium dataset (78.2%; Figure 6), and


728 across all sequencing depths tested, including 1/32 of the original depth (74.3%; Supplemental


729 Figure 3). Thus, our experiments show that the information about ploidy is unevenly distributed


730 among loci, but leveraging information from multiple loci provides the most stable estimates of


731 ploidy.


732 **What information is sorAI using**


733 With any ML approach, a natural question is what features of the data most influence the


734 results? Perhaps not surprisingly, the amount of missing data appears to be the greatest predictor


735 of performance of a locus in the CNN models (Figure 5A). There also is a weak negative


736 correlation of the Shannon entropy of the read alignment for a locus and the resulting AUROC


737 score (Figure 5C), suggesting that more complex alignments are not as informative for predicting


738 ploidy. However, it remains difficult to determine a priori which loci will perform best in the CNNs.


739 Although it is intuitive that combining information from multiple loci in the ensemble models


740 improves upon predictions from the single-locus CNN models (Figure 3), the performance of the


741 ensemble models is difficult to predict from the CNN models. For example, combining the loci with


742 the best CNN models does not generate the best ensemble model. This also suggests that the


743 CNN models and the ensemble models may use different features of the loci. The difficulty of


744 predicting the performance of different loci emphasizes the potential use of an approach that can


745 evaluate the performance of many loci using a large training set.


746 Furthermore, our randomization experiments (i.e., where rows and columns are shuffled


747 in read alignments) demonstrate that the ML models recognize and capitalize on variation among


748 alignment sites to accurately infer ploidy. Randomly swapping alignment columns greatly reduces


749 the accuracy of the ML approach (Figure 4B), indicating that some sites in the training data contain


750 more information about ploidy than others. This is in contrast to the approach of nQuire and


751 nQuack, in which all alignment sites equally contribute to the site frequency distributions, and


752 information about their order is discarded. Furthermore, by randomly shuffling the nucleotides


753 from different reads from the same sample, we find that maintaining the covariance among sites


754 also contributes information about the ploidy of the sample, especially in the ensemble models


755 (Figure 4B). The potential information in the neighboring sites in determining ploidy can be


756 demonstrated in an example with four sequence reads that are each two base pairs in length:


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 26


757 “AG”, “AT”, “CG”, and “CT”. A method based on read frequencies that treats each site


758 independently, like nQuire or nQuack, would interpret these reads coming from a diploid because


759 of the frequency of each allele in the two sites is 50% (i.e., 50% A and 50% C in site 1; 50% G


760 and 50% T in site 2). However, if the sites are considered together, accounting for the covariance


761 among sites, then these sequences would be interpreted as four distinct alleles, suggesting they


762 did not come from a diploid. By using information about each site and accounting for the states of


763 the neighboring sites in each read, the ML approach achieves its greatest accuracy (Figure 4B).


764 **Limitations of Machine Learning Models**


765 While the ML approach overall performed well, our experiments suggest we still might


766 expect error rates of 22–29% using the RF model. So why aren’t we able to achieve higher


767 accuracy? One potential source of error is the training set. To assemble the training set, we first


768 determined whether a sample was from diploid or polyploid based on species chromosome


769 counts; however, these can be misleading. For example, some fern taxa with high chromosome


770 numbers are actually diploid (e.g., Haufler and Soltis, 1986; Wolf et al., 1987; Rizzieri et al., 2026).


771 Also, we do not have chromosome counts from the specific fern samples from which we have


772 targeted capture data. There are numerous cases of fern species complexes that include both


773 diploid and polyploid individuals (e.g., Manton, 1950; Wagner, 1954; Hanušová et al., 2019; Pelosi


774 et al., 2024), and therefore, it is possible that the sequence sample came from an individual with


775 a different ploidy than the individual from which the chromosome count was obtained.


776 An alternate approach to assemble large and accurate training sets would be to generate


777 them through simulations. This is conceptually similar to the approach of Sutherland et al. (2024)


778 to infer ancient whole genome duplications from Ks plots using ML models trained on simulated


779 datasets. Indeed, there are new tools that can simulate complex polyploid scenarios (e.g.,


780 Blischak et al., 2023; Conant, 2023; Dunn and Sethuraman, 2024, 2025). By simulating specific


781 polyploid evolution scenarios, it also might be possible to extend the current model to distinguish


782 among different ploidy levels or distinguish allopolyploids from autopolyploids. While such an


783 approach is promising, even our best models of sequence evolution likely fail to incorporate


784 realistic complexity (Trost et al., 2024), and such training sets may have their own biases.


785 There also likely are inherent limitations to the information about ploidy in target capture


786 datasets that may limit any approach to infer ploidy. The GoFlag probe set was designed from


787 alignments of single copy nuclear genes identified by the 1KP transcriptome sequencing project


788 (One Thousand Plant Transcriptomes Initiative, 2019). Focusing on single copy loci often is


789 desirable for phylogenetic analyses because they presumably minimize errors caused by


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 27


790 undetected paralogy. However, the lack of duplicate copies in these genes likely reflects strong


791 selection to eliminate extra copies after a gene duplication or polyploidy event, erasing the


792 evidence of polyploidy. Although some studies have focused on the use of nQuire for inferring


793 ploidy using target capture data (Viruel et al., 2019, 2023), originally both nQuire and nQuack


794 were described for use more broadly with genomic data, which likely would include more multi

795 copy genes. Our ML approach can easily be adapted to any short read HTS datasets, but since


796 targeted capture is so widely adopted for phylogenetics, there is value in exploring its potential


797 for inferring ploidy. One future approach might use the growing abundance of genomic and


798 transcriptomic data to determine the genes that are most indicative of ploidy level and add probes


799 that cover these genes in future targeted capture probe sets. For example, in the ferns Pelosi et


800 al. (2022) identified convergence in the patterns of genes retained in duplicate across


801 independent paleopolyploidy events; confirming the duplicate nature of these loci in newly


802 generated chromosome-scale genomes (e.g., Li et al., 2018; Rizzieri et al., 2026; Xia et al., 2026)


803 could identify these ploidy-informative loci.


804 The _Lygodium_ dataset provided a challenge for all methods to infer ploidy, and also points


805 the direction towards possible approaches to improve performance in the future. The generally


806 lower performance using nQuack, nQuire, and the CNN models with _Lygodium_ (Figure 6) likely


807 are due, at least in part, to the higher levels of missing data than occur in many targeted capture


808 datasets (see Pelosi et al., 2024, on average only 330 biallelic sites were retained after filtering


809 with nQuire). _Lygodium_ appears to contain a combination of autopolyploids and allopolyploids


810 (Pelosi et al., 2024), and this also may contribute to reduced accuracy. Our ML training set does


811 not distinguish between autopolyploids and allopolyploids. However, if there are relatively few


812 autopolyploid ferns, as suggested in Wagner and Wagner (1980; but see Barker et al., 2016), the


813 ML models may have little training on patterns associated with autopolyploidy. While the accuracy


814 of the CNN, Ensemble, and Hybrid approaches in _Lygodium_ is lower than we see in the test set


815 across ferns (Figure 6), the relatively higher AUROC scores indicate that the relative probability


816 of ploidy output from the models is still generally higher in polyploids than in diploids. Thus, in


817 theory, we could likely improve upon the accuracy by using a different probability cutoff for


818 inferring a polyploid. However, it is difficult to determine the optimal cutoff a priori. The RF


819 approach provides a more workable solution that maximizes the performance of the ML


820 approaches by combining insights from all CNN models. In fact, it appears to perform as well as


821 on the original test set on both allo- and auto-polyploids, with little evident bias. More investigation


822 is needed to broadly determine the best approaches to infer ploidy from the ML results across


823 various datasets and how to best quantify uncertainty associated with ML approaches. No matter


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 28


824 the method one is using to infer ploidy, the _Lygodium_ example points towards the importance of


825 uncertainty (Beaulieu and O’Meara, 2025).


826 Unlike nQuire or nQuack, the specific models we present in this paper were trained on a


827 specific probe set in one large land plant clade and may not be easily applied to other clades or


828 probe sets. Although the GoFlag 408 probe set was designed to cover all flagellate land plants,


829 including all gymnosperms (Breinholt et al., 2021), each clade poses its own challenges. For


830 example, the bryophytes likely will have very different patterns of sequence variation associated


831 with polyploidy than ferns simply because most DNA extractions used gametophyte rather than


832 sporophyte tissue. Polyploidy is rare in gymnosperms; _Ephedra_ includes by far the most polyploid


833 taxa (see Ickert-Bond et al., 2020), yet, _Ephedra_ samples have extremely low locus recovery rates


834 with GoFlag sequencing, likely due to probe design (Ickert-Bond and Burleigh, unpublished).


835 Beyond these more technical issues, ultimately our ability to generalize these models to different


836 clades depends on the degree to which the same loci or same sites associated with ploidy in ferns


837 also would be associated with ploidy in other clades. Notably, the rediploidization process in ferns


838 appears to differ from that in other clades (e.g., angiosperms; Haufler, 1987; Kinosian, 2026); the


839 biological signal of polyploidy that the ML approach implemented here is likely not the same in


840 other lineages. It is straightforward to train new ML models for inferring ploidy from alignments of


841 sequence reads using our approach in different clades and probe sets. This investment is more


842 computationally intensive than using more easily generalizable approaches such as nQuire or


843 nQuack; however, they offer the advantage of being tailored to potentially heterogeneous or


844 idiosyncratic patterns associated with ploidy that may occur in different clades or loci. Once the


845 models are developed, they are quick and simple to run, even on a laptop.


846 **Best practices for applying this method to new datasets**


847 Based on our results, we outline several practical recommendations for researchers


848 applying this approach to new targeted capture datasets. First, prediction accuracy for the CNN


849 or ensemble models depends on input data quality: our downsampling analysis (Supplemental


850 Figure 3) and the relationship between AUROC and alignment gap fraction (Figure 5A) both


851 indicate that higher-depth, higher-quality target-capture data — comparable to most GoFlag loci


852 used here — yield more reliable predictions with the CNN or ensemble models, while lower depth


853 or gap-rich alignments degrade model performance. However, the random forest (RF) model


854 appears to be relatively robust to data quality, achieving approximately 71–78% accuracy across


855 all sequencing depths tested (74.3% at 1/32 of full depth) and 78.2% in the Lygodium dataset,


856 where the accuracy of the CNN and ensemble models is reduced. Although it is possible to


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 29


857 achieve potentially higher levels of accuracy in high quality datasets from single locus CNN


858 models or two locus ensemble models, unless the user is confident of the quality and abundance


859 of their data, in most cases we recommend using the predictions of the RF model.


860 We did not test the models on samples from taxa outside of the training set (i.e., non

861 ferns) although many or all these loci can be amplified in other groups with existing probe sets.


862 The GoFlag408 flagellate land plant probe set can be used to generate targeted capture data


863 from any non-angiosperm land plants (Breinholt et al., 2021), and there exist GoFlag probe sets


864 to amplify the same loci in angiosperms (Endara et al., in prep.) and algae (Sigel and Burleigh, in


865 prep.). There also is much overlap in the loci from the Angiosperm 353 probe set (Johnson et al.,


866 2019) and the GoFlag probe sets (Breinholt et al., 2021; Endara et al., in prep.). In those cases,


867 we suspect that individual locus-level predictions will be substantially noisier, and we recommend


868 against relying on any single locus (i.e., using CNN or ensemble models). Where feasible, users


869 with their own ploidy verified reference samples should re-train locus-specific and ensemble


870 models on their own data. When retraining is not feasible, aggregating information across many


871 loci — particularly using the random forest combiner, may provide the most robust predictions for


872 taxa outside the training distribution.


873 Finally, we recommend that predicted ploidy be treated as a probabilistic rather than


874 categorical outcome in downstream applications, or minimally that downstream analyses account


875 for potential error in the ploidy designations output from these models. Because our models output


876 a continuous probability of polyploidy rather than a hard classification, this probability itself can


877 serve as a built-in measure of prediction confidence, and downstream analyses (e.g., comparative


878 phylogenetic studies that incorporate inferred ploidy) can propagate this uncertainty rather than


879 treating each call as certain. Additional uncertainty estimates could be obtained by subsampling


880 reads to generate a bootstrap distribution of predictions per sample, or through other established


881 machine-learning approaches for uncertainty quantification. We did not implement these here, but


882 see them as a valuable direction for future work.


883 **Acknowledgments**


884 This work was funded in part by U.S. National Science Foundation (GoFlag; DEB

885 1541506). J.A.P. was supported by USDA NIFA Postdoctoral Fellowship #2024-67012-43394.


886 F.R. and J.Z. were supported by NIH grant R35GM15490.


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 30


887 **Author Contributions**


888 All authors designed the experiments, performed the analyses, and wrote the paper.


889 **Data Availability Statement**


890 The sorAI code, including the preprocessing, training, and inference pipelines and the


891 trained random forest model, is available on GitHub at &#91;https://github.com/Fahimehgit/sorai.&#93;(https://github.com/Fahimehgit/sorai)


892 Trained model weights are available on Hugging Face &#91;at&#93;(https://huggingface.co/Fahimehr140/sorai)


893 &#91;https://huggingface.co/Fahimehr140/sorai. Per-sample model predictions and performance&#93;(https://huggingface.co/Fahimehr140/sorai)


894 metrics are provided in Supplemental Table S1.

## 895 REFERENCES


896 Akiba, T., S. Sano, T. Yanase, T. Ohta, and M. Koyama. 2019. Optuna: A next-generation


897 hyperparameter optimization framework. Proceedings of the 25th ACM SIGKDD


898 International Conference on Knowledge Discovery &amp; Data Mining: 2623–2631.


899 Augusto Corrêa dos Santos, R., G.H. Goldman, and D.M. Riaño-Pachón. 2017. ploidyNGS:


900 visually exploring ploidy with Next Generation Sequencing data. Bioinformatics 33: 2575–


901 2576.


902 Baker, W.J., P. Bailey, V. Barber, A. Barker, S. Bellot, D. Bishop, L.R. Botigue, G. Brewer, T.


903 Carruthers, J.J. Clarkson, J. Cook, R.S. Cowan, S. Dodsworth, N. Epitawalage, E.


904 Francoso, B. Gallego, M. Johnson, J.T. Kim, K. Leempoel, O. Maurin, C. McGinnie, L.


905 Pokorny, S. Roy, M. Stone, E. Toledo, N.J. Wickett, A.R. Zuntini, W.L. Eiserhardt, P.J.


906 Kersey, I.J. Leitch, and F. Forest. 2022. A comprehensive phylogenomic platform for


907 exploring the angiosperm tree of life. Systematic Biology 71: 301–319.


908 Barker, M.S., N. Arrigo, A.E. Baniaga, Z. Li, and D.A. Levin. 2016. On the relative abundance of


909 autopolyploids and allopolyploids. New Phytologist 210: 391–398.


910 Beaulieu, J.M., and B.C. O’Meara. 2025. Navigating “tip fog”: Embracing uncertainty in tip


911 measurements. Evolution 79: 1131–1142.


912 Blischak, P.D., M. Sajan, M.S. Barker, and R.N. Gutenkunst. 2023. Demographic history inference


913 and the polyploid continuum. Genetics 224: iyad107.


914 Breinholt, J.W., S.B. Carey, G.P. Tiley, E.C. Davis, L. Endara, S.F. McDaniel, L.G. Neves, E.B.


915 Sessa, M. von Konrat, S. Chantanaorrapint, S. Fawcett, S.M. Ickert-Bond, P.H. Labiak, J.


916 Larraín, M. Lehnert, L.R. Lewis, N.S. Nagalingum, N. Patel, S.A. Rensing, W. Testo, A.


917 Vasco, J.C. Villarreal, E.W. Williams, and J.G. Burleigh. 2021. A target enrichment probe


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 31


918 set for resolving the flagellate land plant tree of life. Applications in Plant Sciences 9:


919 e11406.


920 Brewer, G.E., J.J. Clarkson, O. Maurin, A.R. Zuntini, V. Barber, S. Bellot, N. Biggs, et al. 2019.


921 Factors affecting targeted sequencing of 353 nuclear genes from herbarium specimens


922 spanning the diversity of angiosperms. Frontiers in Plant Science 10: 1102.


923 Conant, G.C. 2023. POInT: Modeling polyploidy in the era of ubiquitous genomics. Methods in


924 Molecular Biology 2545: 77–90.


925 Cronn, R., B.J. Knaus, A. Liston, P.J. Maughan, M. Parks, J.V. Syring, and J. Udall. 2012.


926 Targeted enrichment strategies for next-generation plant biology. American Journal of


927 Botany 99: 291–311.


928 Darlington, C.D., and A.P. Wylie. 1956. Chromosome atlas of flowering plants. The MacMillan


929 Company. New York.


930 Dolezel, J., and J. Bartos. 2005. Plant DNA flow cytometry and estimation of nuclear genome


931 size. Annals of Botany 95: 99–110.


932 Dunn, T., and A. Sethuraman. 2024. Accurate inference of the polyploid continuum using forward

933 time simulations. Molecular Biology and Evolution 41: msae241.


934 Dunn, T., and A. Sethuraman. 2025. Hidden in plain sight. How Ks histogram dynamics can reveal


935 and obscure whole genome duplications. bioRxiv 2025-11.


936 Eserman, L.A., S.K. Thomas, E.E.D. Coffey, and J.H. Leebens-Mack. 2021. Target sequence


937 capture in orchids: Developing a kit to sequence hundreds of single-copy loci. Applications


938 in Plant Sciences 9: e11416.


939 Fawcett, S., A.R. Smith, M. Sundue, J.G. Burleigh, E. Sessa, L.-Y. Kuo, C.-W. Chen, W.L. Testo,


940 M. Kessler, GoFlag Consortium, and D.S. Barrington. 2021. A global phylogenomic study


941 of the Thelypteridaceae. Systematic Botany 46: 891–915.


942 Folk, R., H.R. Kates, R. LaFrance, D.E. Soltis, P.S. Soltis, and R.P. Guralnick. 2021. High

943 throughput methods for efficiently building massive phylogenies from natural history


944 collections. Applications in Plant Sciences e11410.


945 Forrest, L.L., M.L. Hart, M. Hughes, H.P. Wilson, K.-F. Chung, Y.-H. Tseng, and C.A. Kidner.


946 2019. The limits of Hyb-Seq for herbarium specimens: Impact of preservation techniques.


947 Frontiers in Ecology and Evolution 7: 439.


948 Gaynor, M.L., J.B. Landis, T.K. O’Connor, R.G. Laport, J.J. Doyle, D.E. Soltis, J.M. Ponciano,


949 and P.S. Soltis. 2024. nQuack: An R package for predicting ploidal level from sequence


950 data using site-based heterozygosity. Applications in Plant Sciences 12: e11606.


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 32


951 Hanušová, K., M. Čertner, T. Urfus, P. Koutecký, J. Košnar, C.J. Rothfels, V. Jarolímová, J.


952 Ptáček, and L. Ekrt. 2019. Widespread co-occurrence of multiple ploidy levels in fragile


953 ferns ( _Cystopteris fragilis_ complex; Cystopteridaceae) probably stems from similar


954 ecology of cytotypes, their efficient dispersal and inter-ploidy hybridization. Annals of


955 Botany 123: 845–855.


956 Haufler, C.H. 1985. Pteridophyte evolutionary biology: the electrophoretic approach. Proceedings


957 of the Royal Society of Edinburgh 86B: 315–323.


958 Haufler, C.H. 1987. Electrophoresis is modifying our concepts of evolution in homosporous


959 pteridophytes. American Journal of Botany 74: 953–966.


960 Haufler, C.H., and D.E. Soltis. 1986. Genetic evidence suggests that homosporous ferns with high


961 chromosome numbers are diploid. Proceedings of the National Academy of Sciences,


962 USA 83: 4389–4393.


963 Henniges, M.C., E. Johnson, J. Pellicer, O. Hidalgo, M.D. Bennett, and I.J. Leitch. 2023. The


964 Plants DNA C-Value Database: A one-stop shop for plant genome size data. In: S. Garcia


965 and N. Nualart (eds.). Plant Genomic and Cytogenetic Databases. Methods in Molecular


966 Biology, vol. 2703. Humana Press, Springer Nature, New York: 111–122.


967 Ickert-Bond, S.M., A. Sousa, Y. Min, I. Loera, J. Metzgar, J. Pellicer, O. Hidalgo, and I.J. Leitch.


968 2020. Polyploidy in gymnosperms – Insights into the genomic and evolutionary


969 consequences of polyploidy in _Ephedra_ . Molecular Phylogenetics and Evolution 147:


970 106786.


971 Johnson, M.G., L. Pokorny, S. Dodsworth, L.R. Botigue, R.S. Cowan, A. Devault, W.L. Eiserhardt,


972 N. Epitawalage, F. Forest, J.T. Kim, J.H. Leebens-Mack, I.J. Leitch, O. Maurin, D.E. Soltis,


973 P.S. Soltis, G.K.-S. Wong, W.J. Baker, and N.J. Wickett. 2019. A universal probe set for


974 targeted sequencing of 353 nuclear genes from any flowering plant designed using k

975 medoids clustering. Systematic Biology 68: 594–606.


976 Kates, H.R., J.R. Doby, C.M. Siniscalchi, R. LaFrance, D.E. Soltis, P.S. Soltis, R.P. Guralnick,


977 and R.A. Folk. 2021. The effects of herbarium specimen characteristics on short-read


978 NGS sequencing success in nearly 8000 specimens: Old, degraded samples have lower


979 DNA yields but consistent sequencing success. Frontiers in Plant Science 12: 669064.


980 Katoh, K., and D.M. Standley. 2013. MAFFT multiple sequence alignment software version 7:


981 improvements in performance and usability. Molecular Biology and Evolution 30: 772–


982 780.


983 Kingma, D.P., and J. Ba. 2014. Adam: A method for stochastic optimization. arXiv: 1412.6980.


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 33


984 Kinosian, S.P. 2026. Genomics is modifying our concept of evolution in homosporous and


985 heterosporous vascular plants. American Journal of Botany 113: e70248.


986 Klekowski, E.J., and H.G. Baker. 1966. Evolutionary significance of polyploidy in the Pteridophyta.


987 Science 153: 305–306.


988 Koubinová, D., GoFlag Consortium, and J.R. Grant. 2024. Microsatellite content in 397 nuclear


989 exons and their flanking regions in the fern family Ophioglossaceae. Plants 13: 713.


990 Kron, P., J. Suda, and B.C. Husband. 2007. Applications of flow cytometry to evolutionary and


991 population biology. Annual Review of Ecology, Evolution, and Systematics 38: 847–876.


992 Li, F.-W., P. Brouwer, L. Carretero-Paulet, S. Cheng, J. de Vries, P.-M. Delaux, A. Eily, N.


993 Koppers, L.-Y. Kuo, Z. Li, M. Simenc, I. Small, E. Wafula, S. Angarita, M.S. Barker, A.


994 Bräutigam, C. dePamphilis, S. Gould, P.S. Hosmani, Y.-M. Huang, B. Huettel, Y. Kato, X.


995 Liu, S. Maere, R. McDowell, L.A. Mueller, K.G.J. Nierop, S.A. Rensing, T. Robison, C.J.


996 Rothfels, E.M. Sigel, Y. Song, P.R. Timilsena, Y. Van de Peer, H. Wang, P.K.I.


997 Wilhelmsson, P.G. Wolf, X. Xu, J.P. Der, H. Schluepmann, G.K.-S. Wong, and K.M. Pryer.


998 2018. Fern genomes elucidate land plant evolution and cyanobacterial symbioses. Nature


999 Plants 4: 460–472.


1000 Li, H., and R. Durbin. 2009. Fast and accurate short read alignment with Burrows-Wheeler


1001 transform. Bioinformatics 25: 1754–1760.


1002 Li, H., B. Handsaker, A. Wysoker, T. Fennell, J. Ruan, N. Homer, G. Marth, G. Abecasis, and R.


1003 Durbin. 2009. The sequence alignment/map format and SAMtools. Bioinformatics 25:


1004 2078–2079.


1005 Lima, L.V., A. Salino, M. Kessler, G. Rouhan, W.L. Testo, C.S. Argolo, GoFlag Consortium, and


1006 T.E. Almeida. 2023. Phylogenomic evolutionary insights in the fern family Gleicheniaceae.


1007 Molecular Phylogenetics and Evolution 184: 107782.


1008 Mandel, J.R., R.B. Dikow, V.A. Funk, R.R. Masalia, S.E. Staton, A. Kozik, R.W. Michelmore, L.H.


1009 Rieseberg, and J.M. Burke. 2014. A target enrichment method for gathering phylogenetic


1010 information from hundreds of loci: An example from the Compositae. Applications in Plant


1011 Sciences 2: 1300085.


1012 Manton, I. 1950. Problems of cytology and evolution in the Pteridophyta. Cambridge University


1013 Press.


1014 McKain, M.R., M.G. Johnson, S. Uribe-Convers, D. Eaton, and Y. Yang. 2018. Practical


1015 considerations for plant phylogenomics. Applications in Plant Sciences 6: e1038.


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 34


1016 Mendez Reneau, J.I., J.G. Burleigh, and E.M. Sigel. 2023. Target capture methods offer insight


1017 into the evolution of rapidly diverged taxa and resolve allopolyploid homeologs in the fern


1018 genus _Polypodium_ s.s. Systematic Botany 48: 96–109.


1019 Mendez-Reneau, J.I., J.L. Richards, J. Hobbie, E. Bollich, N.J. Kooyers, and E.M. Sigel. 2024.


1020 Lineage diversification and rampant hybridization among subspecies explain taxonomic


1021 confusion in the endemic Hawaiian fern _Polypodium pellucidum_ . American Journal of


1022 Botany 111: e16379.


1023 Moore-Pollard, E.R., D.S. Jones, and J.R. Mandel. 2024. Compositae-ParaLoss-1272: A


1024 complimentary sunflower-specific probe set reduces paralogs in phylogenomic analyses


1025 of complex systems. Applications in Plant Sciences e11568.


1026 One Thousand Plant Transcriptomes Initiative. 2019. One thousand plant transcriptomes and the


1027 phylogenomics of green plants. Nature 574: 679–685.


1028 Pelosi, J.A., E.H. Kim, W.B. Barbazuk, and E.B. Sessa. 2022. Phylotranscriptomics illuminates


1029 the placement of whole genome duplications and gene retention in ferns. Frontiers in Plant


1030 Science 13: 882441.


1031 Pelosi, J.A., B.A. Zumwalde, W.L. Testo, E.H. Kim, J.G. Burleigh, and E.B. Sessa. 2024. All


1032 tangled up: Unraveling phylogenetics and reticulate evolution in the vining ferns, _Lygodium_


1033 (Lygodiaceae, Schizaeales). American Journal of Botany e16389.


1034 PPG I. 2016. A community-derived classification for extant lycophytes and ferns. Journal of


1035 Systematics and Evolution 54: 563–603.


1036 Ranallo-Benavidez, T.R., K.S. Jaron, and M.C. Schatz. 2020. GenomeScope 2.0 and Smudgeplot


1037 for reference-free profiling of polyploid genomes. Nature Communications 11: 1432.


1038 Rice, A., and I. Mayrose. 2023. The Chromosome Counts Database (CCDB). In: S. Garcia and


1039 N. Nualart (eds.). Plant Genomic and Cytogenetic Databases. Methods in Molecular


1040 Biology, vol. 2703. Humana Press, Springer Nature, New York: 123–129.


1041 Rizzieri, Y.C., P. Limpanasittichai, F. Hernández, J.I. Mendez-Reneau, S.D. Holt Jr., B.


1042 Sutherland, T. Mandáková, J.B. Beck, L.-Y. Kuo, N.J. Kooyers, F.-W. Li, and E.M. Sigel.


1043 2026. The dynamic genomes of _Salvinia_ reshape our understanding of fern chromosome


1044 evolution. Proceedings of the National Academy of Sciences, USA 123: e2602084123.


1045 Sigel, E.M., J.I. Mendez-Reneau, B.L. Sutherland, P. Bond Schwartsburd, S.D. Holt Jr., and J.B.


1046 Beck. 2025. Being ghosted: Determining the progenitor genomes and biogeographic


1047 origin of the invasive giant fern _Salvinia_ . Biological Invasions 27: 121.


1048 Simon, J., M. Bosch, and C. Blanché. 2023. CromoCat: Chromosome database of the vascular


1049 flora of the Catalan countries—25 years. In: S. Garcia and N. Nualart (eds.). Plant


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 35


1050 Genomic and Cytogenetic Databases. Methods in Molecular Biology, vol. 2703. Humana


1051 Press, Springer Nature, New York: 131–160.


1052 Stebbins, G.L. 1950. Variation and Evolution in Plants. Columbia University Press, New York.


1053 Sutherland, B.L., G.P. Tiley, Z. Li, M.T.W. McKibben, and M.S. Barker. 2024. SLEDGe: Inference


1054 of ancient whole genome duplications using machine learning. bioRxiv


1055 2024.01.17.574559.


1056 Tiley, G.P., A.A. Crowl, T.O.M. Almary, W.R.Q. Luke, C.L. Solofondranohatra, G. Besnard, C.E.R.


1057 Lehman, A.D. Yoder, and M.S. Vorontsova. 2023. Genetic variation in _Loudetia simplex_


1058 supports the presence of ancient grasslands in Madagascar. Plants People Planet


1059 2023:1–15.


1060 Tiley, G.P., A.A. Crowl, P.S. Manos, E.B. Sessa, C. Solis-Lemus, A.D. Yoder, and J.G. Burleigh.


1061 2024. Benefits and limits of phasing alleles for network inference of allopolyploid


1062 complexes. Systematic Biology syae024.


1063 Trost, J., J. Haag, D. Höhler, L. Jacob, A. Stamatakis, and B. Boussau. 2024. Simulations of


1064 sequence evolution: How (un)realistic they are and why. Molecular Biology and Evolution


1065 41: msad277.


1066 Viruel, J., M. Conejero, O. Hidalgo, L. Pokorny, R.F. Powell, F. Forest, M.B. Kantar, M. Soto


1067 Gomez, S.W. Graham, B. Gravendeel, P. Wilkin, and I.J. Leitch. 2019. A target capture

1068 based method to estimate ploidy from herbarium specimens. Frontiers in Plant Science


1069 10: 937.


1070 Viruel, J., M. Conejero, O. Hidalgo, L. Pokorny, F. Forest, B. Gravendeel, P. Wilkin, and I.J. Leitch.


1071 2023. A bioinformatic pipeline to estimate ploidy level from target capture sequence data


1072 obtained from herbarium specimens. In: T. Heitkam and S. Garcia (eds.). Plant


1073 Cytogenetics and Cytogenomics. Methods in Molecular Biology, vol. 2672. Humana


1074 Press, Springer Nature, New York: 115–126.


1075 Wagner Jr., W.H. 1954. Reticulate evolution in the Appalachian Aspleniums. Evolution 8: 103–


1076 118.


1077 Wagner Jr., W.H., and F.S. Wagner. 1980. Polyploidy in Pteridophytes. In Polyploidy: Biological


1078 Relevance (pp. 199–214). Boston, MA: Springer US.


1079 Weiß, C.L., M. Pais, L.M. Cano, S. Kamoun, and H.A. Burbano. 2018. nQuire: A statistical


1080 framework for ploidy estimation using next generation sequencing. BMC Bioinformatics


1081 19: 122.


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 36


1082 Weitemier, K., S.C. Straub, R.C. Cronn, M. Fishbein, R. Schmickl, A. McDonnell, and A. Liston.


1083 2014. Hyb-Seq: Combining target enrichment and genome skimming for plant


1084 phylogenomics. Applications in Plant Sciences 2: 1400042.


1085 Wolf, P.G., C.H. Haufler, and E. Sheffield. 1987. Electrophoretic evidence for genetic diploidy in


1086 the bracken fern ( _Pteridium aquilinum_ ). Science 236: 947–949.


1087 Wood, T.E., N. Takebayashi, M.S. Baker, I. Mayrose, P.B. Greenspoon, and L.H. Rieseberg.


1088 2009. The frequency of polyploid speciation in vascular plants. Proceedings of the


1089 National Academy of Sciences, USA 106: 13875–13879.


1090 Xia, Z., L. Duan, Y. Fang, Y. Jiang, H. Chen, Y. Yan, A. Wang, Z. Li, Z. Liu, G. Zhao, H. Shen, Y.


1091 Van de Peer, M. Kang, and F. Wang. 2026. Decoding the genome of _Brainea insignis_


1092 reveals insights into fern evolution and conservation. Nature Communications 17: 1292.


1093


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 37

## 1094 Supplemental Figures


1095
1096 **Supplemental Figure 1. Detailed bioinformatics pipeline for processing target-capture**
1097 **reads.** For each sample and locus, BAM files were converted to FASTA format, followed by locus1098 specific extraction, multiple sequence alignment, and alignment processing. Alignment
1099 processing included tokenization of nucleotides (A = 1, C = 2, G = 3, T = 4, gap/other = 0), removal
1100 of internal and external (leading/trailing) alignment gaps, trimming and padding of sequences to
1101 a fixed length of 154 positions, and a final quality-control step retaining the 350 reads per locus
1102 with the fewest gap characters (padding with the gap character when fewer than 350 reads were
1103 available), consistent with the pipeline summarized in Figure 1C and described in Methods.
1104


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 38


1105
1106 **Supplemental Figure 2. Representative CNN architecture for ploidy classification.**
1107 Schematic illustrating the general design of the single-locus CNN models. The model input
1108 consists of a single-channel array representing aligned reads by alignment position (1×351×154,
1109 corresponding to 1 reference sequence plus 350 reads). In this example, the input is passed
1110 through three convolutional blocks (32, 64, and 128 filters, respectively; 3×3 kernels), each
1111 followed by ReLU activation and 2×2 max pooling. The resulting feature maps are reduced via
1112 adaptive average pooling and flattened (236,672 features), then passed through two fully
1113 connected layers (FC1, 128 units; FC2, 64 units), each followed by ReLU activation and dropout.
1114 A final sigmoid output layer produces the predicted probability of polyploidy. Layer sizes are
1115 illustrative: the number of convolutional layers (1–3), filter counts (16–32 per layer), kernel size
1116 (3×3 or 4×4), activation function, pooling type, and fully connected layer width (64–128 units) were
1117 optimized independently for each locus via Optuna (Supplemental Table S1), so the 64- and 1281118 filter blocks shown here fall outside the searched range and do not correspond to any single
1119 trained model.

1120


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 39


1121
1122 **Supplemental Figure 3. Effect of sequencing depth on CNN and RF model performance.**
1123 (A) Test AUROC and (B) test accuracy across sequencing-depth fractions (full, 1/2, 1/4, 1/8, 1/16,
1124 and 1/32) for the ten top-performing single-locus CNN models used for depth-sensitivity
1125 benchmarking. For each locus and depth fraction, non-reference reads were randomly
1126 subsampled to the target depth and randomly reordered to minimize order-dependent bias;
1127 predictions were repeated across four replicate runs, and points show mean performance with
1128 error bars indicating ±1 SD across replicates. (C) Random Forest (RF) performance (accuracy
1129 and AUROC) across the same depth fractions, using the same random forest model and the same
1130 replicate-based depth-reduction and read-reordering procedure.
1131


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 40


1132
1133 **Supplemental Figure 4. Performance of individual CNN, ensemble, hybrid, and random**
1134 **forest models on the** _**Lygodium**_ **dataset. (** A) Accuracy and (B) AUROC for the top-performing
1135 models applied to 60 _Lygodium_ samples with known ploidy, grouped by model type: single-locus
1136 CNN models (blue), ensemble models combining pairs of loci (orange), hybrid models averaging
1137 CNN and ensemble probabilities (green), the random forest model aggregating locus-level CNN
1138 probabilities across all available loci (purple), and the allele-frequency–based methods nQuire
1139 and nQuack (gray; accuracy only, as these methods return ploidy calls rather than probabilities).
1140 The random forest model achieved the highest accuracy (0.782) and AUROC (0.781). The best1141 performing single-locus CNN model reached an accuracy of 0.667 (L295, evaluated on 42
1142 samples). *L138 reached the same accuracy but could be evaluated on only three samples, all
1143 diploid, so its AUROC is undefined, and it is omitted from (B). nQuack achieved an accuracy of
1144 0.643, while nQuire performed below chance (full: 0.281; denoised: 0.263). Red dashed lines
1145 indicate random classification performance (0.50).
1146


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 41


1147
1148 **Supplemental Figure 5. Distributions of predicted probabilities on the** _**Lygodium**_ **dataset.**
1149 (A) Distribution of per-sample predicted probabilities of polyploidy for the CNN (n = 53), ensemble
1150 (n = 48), and hybrid (n = 47) approaches, colored by true ploidy status (diploid = blue, polyploid
1151 = orange). For each sample, the CNN value is the mean probability across the top-performing
1152 CNN models that could score that sample (up to 10), the ensemble value is the mean across the
1153 available top-performing ensemble pairs (up to 5), and the hybrid value is the average of the
1154 sample’s CNN and ensemble values. Histograms are normalized within each ploidy class, and
1155 the dashed vertical line indicates the 0.5 classification threshold. (B) The same values on the logit
1156 scale, with the dashed line indicating logit(p) = 0. CNN predictions were skewed toward diploid
1157 calls, with only 3.8% of samples exceeding the 0.5 threshold despite an observed polyploid
1158 prevalence of 34.0%. Ensemble predictions exceeded the threshold more often than the observed
1159 prevalence (56.2% vs. 31.2%), whereas the proportion of hybrid predictions above the threshold
1160 most closely matched the observed prevalence (29.8% vs. 31.9%).


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 42


1161
1162 **Supplemental Figure 6. Model performance on** _**Lygodium**_ **autopolyploid and allopolyploid**
1163 **samples relative to diploids.** (A, B) Bootstrap accuracy (mean ± 95% CI) for CNN, ensemble,
1164 hybrid, and RF models (per-sample values computed as in Supplemental Figure 5) evaluated on
1165 (A) autopolyploid vs. diploid and (B) allopolyploid vs. diploid samples. Among the CNN, ensemble,
1166 and hybrid approaches, CNN achieved the highest accuracy (autopolyploid: 0.751; allopolyploid:
1167 0.805), while RF was comparable or better (autopolyploid: 0.779; allopolyploid: 0.857). Ensemble
1168 models performed worst (0.465 and 0.554, respectively), and hybrid models were intermediate
1169 (0.652 and 0.703, respectively). (C, D) Bootstrap AUROC (mean ± 95% CI) for the same models
1170 and comparisons. CNN AUROC was substantially higher for autopolyploid vs. diploid
1171 discrimination (0.657) than for allopolyploid vs. diploid discrimination (0.372), while ensemble and
1172 hybrid models showed the opposite pattern, performing better on allopolyploid discrimination
1173 (ensemble: 0.722; hybrid: 0.675) than on autopolyploid discrimination (ensemble: 0.361; hybrid:
1174 0.400). RF achieved the highest AUROC for allopolyploid discrimination (0.856) and matched
1175 CNN on autopolyploid discrimination (0.671 vs. 0.657). Dashed lines in (A, B) indicate nQuire and
1176 nQuack baselines (autopolyploid: nQuire = 0.4, nQuack = 0.0; allopolyploid: nQuire = nQuack =
1177 0.5).


&#91;bioRxiv preprint doi: https://doi.org/10.64898/2026.11.10.765735; this version posted November 12, 2026. The copyright holder for this preprint&#93;(https://doi.org/10.64898/2026.11.10.765735)

(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
&#91;available under a CC-BY 4.0 International license.&#93;(http://creativecommons.org/licenses/by/4.0/)


Rahimi et al. – Machine Learning Ploidy Prediction 43


1178
1179 **Supplemental Figure 7. PATÉ phasing summaries for diploid and polyploid samples.**
1180 Distributions of (A) the proportion of variable loci, (B) mean heterozygosity, and (C) the proportion
1181 of phased loci per sample, estimated with PATÉ assuming all samples were diploid, for all 616
1182 samples with complete phasing results (356 diploid and 260 polyploid). Histograms are
1183 normalized within each ploidy class. Polyploid samples had a higher proportion of variable loci
1184 (median 0.69 vs. 0.29), higher mean heterozygosity (0.0115 vs. 0.0058), and a higher proportion
1185 of phased loci (0.47 vs. 0.17) than diploid samples (two-sided Mann–Whitney U tests, all p &lt;
1186 10⁻²⁹). The distributions overlapped, and each statistic used alone as a classifier achieved an
1187 AUROC of 0.77–0.80.


