KatInterview

Building a Classifier for Authentic vs Synthetic DNA Sequences

Machine LearningModel answer
MediumModel answerMachine Learningmachine-learningsequence-modelingsemi-supervised-learning

Last updated

Design a robust system to classify genuine vs generated DNA sequences, leveraging a massive unlabelled real corpus, minimal ground-truth labels, custom negative generators, and bio-aware metrics.

You are tasked with engineering a production-grade machine learning system to evaluate variable-length DNA sequences composed of the standard nucleotide bases {A, C, G, T}.

You are provided with two distinct assets:

  1. A small, high-confidence labeled dataset containing both authentic ("real") and generated ("fake") DNA sequences.
  2. A large, unlabelled corpus consisting exclusively of confirmed authentic ("real") genomic data.

Your system must accept a novel sequence of arbitrary length and output a probability or binary decision indicating whether the sequence is authentic or synthetic.

Address the following architectural and methodological challenges in detail:

  1. Feature Representation & Encoding: How will you turn variable-length DNA sequences into mathematical vectors? Compare traditional biostatistical approaches (e.g., k-mers, handcrafted motifs) with modern neural approaches (e.g., 1D CNNs, genomic language models).
  2. Problem Formulation & Pretraining: How do you combine the massive positive-only dataset with the small dual-class dataset? Describe how you would integrate self-supervised pretraining, density estimation, and supervised fine-tuning.
  3. Synthetic Negative Generation: How will you synthesize synthetic sequences to augment training without creating easy-to-spot artifacts? Detail generation strategies across varying levels of biological complexity.
  4. Model Architecture & Progression: Define a baseline-to-advanced model hierarchy. Under what conditions should you scale from simple tabular models to large transformer architectures?
  5. Handling Data Imbalance & Small Label Regimes: Outline your strategy for training when labeled negative data is scarce, including loss functions, sampling strategies, and data augmentation.
  6. Data Leakage & Evaluation Pipeline: Detail how to split genomic sequences to prevent target leakage (e.g., sequence homology, reverse complements). What metrics will you prioritize?
  7. Decision Calibration & Risk Optimization: If flagging a real sequence as synthetic carries a severe penalty, how will you calibrate decision thresholds under target deployment priors?
  8. Domain Specific Failure Modes: How will you guard against false signals like GC-content bias, sequence length confounders, and loss of reverse-complement symmetry?

Hints

Hint 1

Consider how sequence similarity tools like CD-HIT or MMseqs2 prevent train-test data leakage in genomic models.

Hint 2

Simple likelihood scores from language models often fail on low-complexity genomic repeats; how can normalized likelihood ratios address this?

Hint 3

Ensure feature representations account for double-stranded DNA symmetry (reverse complements).