DNA methylation is an epigenetic modification in which methyl groups are added to cytosine bases at specific locations called CpG sites throughout the genome. Unlike mutations that permanently alter the DNA sequence, methylation changes are chemically reversible and regulate which genes are switched on or off in different cell types and disease states.
In cancer, methylation patterns change in predictable ways: tumor suppressor genes that should be active are silenced by hypermethylation, while regions that should remain methylated are aberrantly unmethylated. These changes are often consistent across patients with the same cancer type, making methylation an attractive biomarker for diagnosis and classification.
Machine learning (ML) is essential for extracting useful information from methylation data because modern arrays can measure the methylation state of up to 850,000 individual CpG sites simultaneously. Identifying which sites are diagnostically relevant from among hundreds of thousands of candidates requires computational methods that go far beyond what human inspection can accomplish.
Clinical applications have already entered practice: a DNA methylation-based classifier for central nervous system tumors standardized diagnosis across over 100 subtypes and changed the histopathologic diagnosis in approximately 12% of prospective cases. Liquid biopsy approaches combining methylation assays with ML now enable early detection of many cancers from a blood draw, with excellent specificity and accurate tissue-of-origin prediction.
The most widely used platforms for clinical research are Illumina Infinium BeadChip arrays, including the 450K and EPIC versions that interrogate 450,000 and 850,000 CpG sites respectively. These arrays are favored for their established data pipelines, affordability, and comprehensive databases of published reference data. They produce beta values for each CpG site, ranging from 0 (fully unmethylated) to 1 (fully methylated).
For higher resolution, whole-genome bisulfite sequencing (WGBS) provides single-base resolution of methylation patterns across the entire genome. Bisulfite treatment converts unmethylated cytosines to uracil while leaving methylated cytosines unchanged, allowing sequencing to distinguish the two states. This approach is comprehensive but expensive and computationally demanding.
Long-read sequencing platforms including Oxford Nanopore Technologies can detect DNA methylation directly without bisulfite conversion by measuring electrical signals as DNA passes through protein nanopores. This approach preserves longer DNA fragments, reduces chemical damage, and allows simultaneous profiling of methylation and chromatin accessibility through applications like nanoNOMe. It also eliminates PCR amplification bias that can distort methylation quantification in short-read approaches.
Single-cell bisulfite sequencing (scBS-seq) enables methylation measurement at the level of individual cells, revealing the heterogeneity hidden within tissue samples. This is particularly relevant in cancer, where subpopulations of cells with different methylation profiles can drive treatment resistance. However, single-cell methods remain technically challenging, costly, and not yet suitable as clinical diagnostic tools due to high noise and low coverage per cell.
A complete ML workflow for clinical methylation diagnostics begins with defining the specific clinical question, then collecting appropriately matched biological samples. The sample type matters: blood-based methylation differs substantially from tissue methylation, and the assay chosen must reflect the methylation trend relevant to the specific disease being studied.
Data preprocessing is critical and underappreciated. Batch effects, arising from differences in array lots, processing dates, scanner settings, or reagent batches, are a pervasive source of technical noise that can masquerade as biological signal. These effects are identified using principal component analysis and corrected with statistical tools like the ComBat algorithm. For sequencing data, PCR amplification bias and incomplete bisulfite conversion introduce additional distortions that require specific correction strategies.
Feature selection narrows the field from hundreds of thousands of CpG sites to a manageable set of diagnostically relevant markers. CpG sites are not independent: spatially adjacent sites tend to be co-methylated because they are regulated by the same enzymatic processes and transcription factors. This correlation structure creates multicollinearity that can destabilize ML models if not addressed. Methods like LASSO regression, Random Forest importance ranking, and mutual information filtering help identify biologically meaningful markers while controlling for redundancy.
After model training, external validation on independent cohorts is essential. Models evaluated only on the same dataset they were trained on frequently overestimate their real-world performance due to overfitting. Nested cross-validation, which uses an inner loop for hyperparameter tuning and an outer loop for performance estimation, provides more honest performance estimates, particularly for small clinical cohorts.
Support vector machines (SVMs) work well in high-dimensional settings because they find an optimal decision boundary while avoiding overfitting through regularization. They are particularly suited to methylation data where the number of CpG features exceeds the number of patient samples. However, their outputs are difficult to interpret biologically, and they require careful kernel selection. In one benchmark study of brain tumor methylation data from 2,801 samples, calibrated SVM with linear kernels achieved the lowest misclassification error of 2.1%.
Random Forest (RF) builds many decision trees simultaneously and combines their results. It handles correlated features and missing data naturally, provides feature importance scores that enable biological interpretation of which CpG sites drive classification, and is computationally efficient. RF-based classifiers have entered clinical practice, including the Heidelberg CNS Tumor Methylation Classifier trained on 7,495 methylation profiles that achieves 95% accuracy across 184 brain tumor subclasses.
Gradient boosting machines including XGBoost sequentially build models where each new tree corrects errors from the previous one, capturing complex nonlinear relationships between CpG sites and clinical outcomes. They provide interpretable feature importance scores and handle missing data, but are sensitive to hyperparameter settings and computationally expensive. One notable application used XGBoost to enhance methylation detection precision in nanopore sequencing data by 11%.
Deep learning architectures including convolutional neural networks, autoencoders, LSTM networks, and transformer-based models can capture complex nonlinear patterns in methylation data that traditional methods miss. MethylBERT, a transformer-based model, identified tumor-derived methylation patterns in liquid biopsies with a 0.987 correlation for tumor purity estimation. However, deep learning typically requires large datasets, substantial compute, and post-hoc interpretability tools like SHAP or Grad-CAM to explain its decisions.
A comprehensive benchmarking study of methylation classifiers on a brain tumor cohort of 2,801 samples across 91 classes compared Random Forest, Elastic Net, SVM, and XGBoost. The key finding was that no model universally dominated: calibrated SVM with linear kernels achieved the lowest misclassification error (2.1%), while Random Forest and Elastic Net both reached 2.7% misclassification when tuned, and XGBoost with default settings performed poorly at 16% misclassification but improved substantially with tuning.
Data harmonization has an outsized impact on model performance. A study classifying whole-blood methylation for Parkinson's disease and schizophrenia found that tree-based models like LightGBM achieved up to 97% accuracy on harmonized data, highlighting that removing batch effects before model training is often more impactful than choosing a more sophisticated algorithm.
The choice of preprocessing and feature selection method often matters more than model architecture. In a depression classification study across eight cohorts, Random Forest achieved the highest AUC of 0.76 on non-harmonized data using limma-selected features, while deep learning reached AUC up to 0.91 with pre-selected features but dropped below 0.57 when data were harmonized. This suggests that harmonization, while technically correct, can remove biological signals when implemented imperfectly.
The practical recommendation from the benchmarking literature is to conduct dataset-specific benchmarking rather than assuming any single method is optimal. Researchers should test multiple models with tailored preprocessing and use evaluation metrics beyond accuracy, including Brier score and calibration curves, which assess the quality of probabilistic predictions rather than just classification cutoffs.
The most prominent clinical success is the Heidelberg CNS Tumor Methylation Classifier, a random forest model trained on 7,495 methylation profiles that classifies brain tumors into 184 subtypes. This system has been integrated into routine neuropathology workflows through an online portal and has changed diagnoses in approximately 12% of cases where histopathology alone was insufficient, demonstrating that methylation classifiers can provide clinically actionable information beyond what conventional pathology offers.
In rare genetic diseases, episignature analysis correlates a patient's blood methylation profile with disease-specific methylation signatures to confirm diagnoses. This approach has proven particularly valuable for rare neurodevelopmental syndromes where genetic sequencing identifies a variant of uncertain significance: if the patient's methylation profile matches the known episignature for that syndrome, it provides functional evidence that the variant is disease-causing. The EpiSign platform has brought this approach into clinical genetics workflows.
In liquid biopsy applications, targeted methylation sequencing of circulating cell-free DNA combined with ML classifiers enables multi-cancer detection and tissue-of-origin prediction from blood. Commercial platforms like GRAIL's Galleri test use this principle, and the approach shows excellent specificity in validation studies. Sensitivity for early-stage cancers remains an active area of improvement.
Foundation models for DNA methylation, including MethylGPT trained on over 150,000 human methylomes and CpGPT, are emerging as generalizable platforms that can be fine-tuned for specific clinical tasks. These models capture contextual relationships between CpG sites and can support imputation of missing data, age prediction, and disease classification across cohorts, representing a shift from task-specific models to general-purpose methylation intelligence.
Batch effects and platform discrepancies are among the most consequential technical barriers. Methylation measurements from the same sample can differ substantially between array generations, sequencing platforms, laboratory protocols, and even processing dates. Without harmonization, models trained in one setting may fail when deployed in a different laboratory, undermining clinical utility. Developing robust harmonization pipelines that remove technical noise without eliminating biological signal is an ongoing challenge.
Small and imbalanced cohorts compromise generalizability in many published methylation ML studies. Rare diseases and rare cancer subtypes may have only dozens to hundreds of samples available globally, making it difficult to train models that generalize beyond the specific populations studied. Data augmentation, transfer learning, and federated learning across institutions are partial solutions, but the fundamental constraint of biological data scarcity remains.
Many published deep learning models lack clinical-grade explainability. Regulators and clinicians require not just that a model is accurate, but that its reasoning can be audited and its decisions attributed to specific biological features. While tools like SHAP and Grad-CAM add post-hoc explainability, these do not always faithfully represent what the model actually learned. Newer inherently interpretable architectures and validation frameworks for explanations are active research priorities.
For multi-cancer early detection, current tests show high specificity but sensitivity for Stage I disease remains limited, particularly for cancers that shed little DNA into the bloodstream such as brain tumors and certain early-stage prostate cancers. Improving early-stage sensitivity while maintaining high specificity at the population level is critical for screening applications, where false positives trigger invasive follow-up procedures in healthy individuals.