Inspiration
Genetic sequencing has drastically accelerated, but translating raw DNA sequences into clinical insights remains a massive bottleneck. Identifying whether a genetic variant is pathogenic often requires labor-intensive manual analysis. We wanted to build an intelligent, end-to-end classification tool capable of instantly spotting destructive genetic mutations. By automating this screening process, our goal is to help researchers and clinicians quickly prioritize hazardous variants in high-risk, cancer-associated genes.
What it does
The project acts as a high-precision DNA sequence classifier that determines whether a gene's coding sequence (CDS) carries a pathogenic mutation or is benign.
When a raw sequence is submitted, it analyzes the data for critical disruptions and flags:
- Benign — A valid coding sequence without disruptive mutations.
- Pathogenic — A sequence containing severe defects like premature stop codons (nonsense mutations), frameshift insertions, frameshift deletions, or nonsense clusters.
The system is trained and benchmarked against 10 critical cancer-associated genes: BRCA1, BRCA2, TP53, PTEN, APC, MLH1, MSH2, MSH6, VHL, and RB1.
How we built it
We engineered a hybrid machine learning pipeline that fuses deep contextual embeddings with hand-crafted biological priors:
- Contextual Encoding: We used a pre-trained DNABERT transformer (
zhihan1996/DNA_bert_6) to extract a 768-dimensional tokenized sequence embedding ([CLS]vector) via $k$-mer tokenization. - Biological Priors: Because $k$-mer boundaries can obscure reading frames, we built a custom extraction module to track frame-0 features. This computes a 12-dimensional vector capturing explicit biological signals like premature stop codon positions, stop density, GC content, and start-codon presence.
- Feature Fusion: The 768-dim transformer output and 12-dim biological vector are concatenated and fed through a dense layer for final classification.
- Interface: We wrapped the inference engine in a command-line interface (
predict.py) and a clean, interactive Flask web application (app.py) for rapid browser-based analysis.
Challenges we ran into
- The Overlapping $k$-mer Blindspot: Transformers trained on overlapping $k$-mers struggle to inherently track strict reading frames. If a mutation shifts the reading frame, the raw sequence patterns look similar to the transformer, but the biological outcome is catastrophic. Resolving this required building our custom reading-frame-aware feature extractor to explicitly force biological rules into the network.
- Hugging Face Hub Inconsistencies: During active testing, transient network issues with downloading the large DNABERT base model occasionally stalled our automated scripts. We overcame this by implementing a robust local caching system and fallback environment configurations (
TRANSFORMERS_OFFLINE=1).
Accomplishments that we're proud of
- Perfect Benign Recall: We achieved an impressive 1.000 Benign Recall (zero false positives) on our held-out test set, which is crucial for diagnostic environments where false alarms cause immense patient anxiety.
- High Over-all Performance: The model reached an overall Accuracy of 96.7% and an AUC of 0.979, validating that our hybrid fusion network successfully maps genomic patterns.
- Outperforming the Baseline: We integrated a fast $k$-mer-frequency baseline utilizing classical algorithms (Random Forest and Logistic Regression) to verify our architectural complexity, proving that our transformer-fusion architecture significantly clears the accuracy floor.
What we learned
We learned that deep learning models shouldn't always operate as pure black boxes—especially in computational biology. While heavy transformer models excel at general sequence pattern matching, injecting minor, highly specific domain knowledge (like our 12-dimensional codon vector) acts as an essential anchor that keeps the model grounded in real molecular biology rules.
What's next for Gene Mutation Prediction
- Expanding to Missense Mutations: The current iteration focuses heavily on structural shifts and truncations. The next major step is optimizing the architecture to catch missense mutations, where a single nucleotide substitution alters an amino acid without breaking the structural frame.
- Real-World Benchmarking: We plan to move beyond our realistic synthetic pipeline and validate our pipeline's performance directly against real human variant sets curated from the public ClinVar database.
Built With
- css3
- cuda
- deep-learning
- dnabert
- flask
- html5
- javascript
- natural-language-processing
- python
- pytorch
- scikit-learn
- transformers
Log in or sign up for Devpost to join the conversation.