Enzyme EC classification, v2: homology, residue profiles and a hierarchical head

Submission for the Leak CURBER enzyme classification benchmark (DA3410 Deep Learning Lab, Project 2). Given an enzyme amino-acid sequence, the model predicts one fully specified EC number. It runs on CPU only and offline, inside the evaluator's 2 vCPU / 16 GB / 10 minute budget.

Local results

Five folds cover all 14,466 training clusters at 50% identity. Evaluation uses 14,103 non-redundant queries (one per cluster, best hit under 60% identity). Every score is out-of-fold for the reference, the head and the reranker.

Matched reweights queries to the identity histogram of the real inputs. Raw does not, and is pessimistic because held-out clusters sit further from train than the real inputs do. Treat the two as a range.

system matched L4 L3 L2 L1 raw L4
DIAMOND bitscore vote 0.719 0.884 0.900 0.921 0.669
v1 as shipped 0.732 0.906 0.924 0.951 0.683
v2 (this model) 0.739 0.912 0.930 0.956 0.692
perfect ranking of the same candidates 0.794 0.925 0.940 0.961 0.754

v2 against v1 as shipped, paired on identical queries: L4 +0.0074, 95% CI [+0.0050, +0.0100].

"v1 as shipped" is an approximation: v1's method and features retrained on 13% of the clusters, close to the 1,830 clusters the real v1 reranker saw. The shipped v1 model itself cannot be scored here, because its reference contains these queries.

These are local estimates, not leaderboard scores. The v1 method's own folds reported 0.693, on a redundant population; numbers from the two evaluations are not comparable.

How it works

  1. Homology. DIAMOND --very-sensitive searches each input against all 186,488 unique training sequences, keeping 200 hits with full alignments.

  2. Residue profiles. The fourth EC digit is usually set by a few specificity-determining residues. Each candidate EC's aligned homologs are projected onto the query's columns to form a Henikoff-weighted profile, compared with the profile of its competitors, overall and on the most discriminative columns. This is a CPU-budget route to the residue-level focus of HIT-EC and the active-site focus of GraphEC.

  3. Protein language model. Where the best bitscore is under 150, an ESM-2 (35M) embedding passes through a head combining CLEAN's supervised contrastive projection with HIT-EC's hierarchical L1-L4 outputs, trained with cluster-balanced sampling. It adds L4 and L3 probabilities, centroid similarity, nearest-neighbour evidence and extra candidates.

  4. Learning to rank. A bag of five LightGBM LambdaRank models scores each (query, candidate EC) pair on 47 features. Training covers 36,543 queries from all clusters, and a quarter of queries train without embeddings, which is the state a deadline can leave them in.

  5. Fallback. Anything with no evidence receives the most frequent training EC.

Reliability

  • No file over 16 MiB. The task forbids larger files. The DIAMOND index is built in the Dockerfile, --hit-membuf keeps DIAMOND's intermediate data in memory, and hits arrive through a pipe. Verified at the full 11,367 inputs with RLIMIT_FSIZE = 16 MiB.
  • Safety net. A 16 s --fast search covers the inputs first, in case the main search is cut off.
  • Deadlines on every stage, and a valid output file on any failure. Tested with the main search killed by its deadline, and with an unusable DIAMOND index.
  • Runtime: 304 s for 11,367 inputs at 2 threads on an Apple M4 (limit 600 s). An evaluator's vCPUs may be slower; the deadlines cover that case.

What was measured and rejected

idea L4 effect decision
Proposing vocabulary ECs with no training sequence -0.0005 dropped
Per-EC reliability encoding -0.0002 dropped
Two-head ensemble -0.0002 dropped
Embedding every query +0.0008 out of budget
Searching the inputs against each other not run real inputs have almost no close siblings

Usage

docker build --platform linux/amd64 -t my-enzyme-model .
docker run --rm --platform linux/amd64 --user 1000:1000 --network none --cpus 2 --memory 16g \
  -v "$PWD/../../data:/input:ro" -v "$PWD/output:/output" \
  my-enzyme-model python /app/predict.py \
  --input /input/val_inputs.parquet --output /output/predictions.jsonl

EC_TIME_BUDGET (default 540 s) and EC_THREADS (default 2) override the defaults.

References

  • Yu, Cui, Li, Luo, Jiang, Zhao. Enzyme function prediction using contrastive learning (CLEAN). Science 379(6639), 2023.
  • Dumontet, Han, Lee, Oh, Kang. Trustworthy prediction of enzyme commission numbers using a hierarchical interpretable transformer (HIT-EC). Nature Communications 17(1), 2026.
  • Song, Yuan, Chen, Zeng, Zhao, Yang. Accurately predicting enzyme functions through geometric graph learning on ESMFold-predicted structures (GraphEC). Nature Communications 15(1), 2024.
  • Buchfink, Reuter, Drost. Sensitive protein alignments at tree-of-life scale using DIAMOND. Nature Methods 18, 2021.
  • Lin et al. Evolutionary-scale prediction of atomic-level protein structure with a language model (ESM-2). Science 379, 2023.

EC vocabulary from ExPASy ENZYME (SIB, CC BY 4.0).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support