Multi-Scale Reversible Chaos Game Representation: A Unified Framework for Sequence Classification
arXiv:2604.18477v1 [cs.LG] 20 Apr 2026
Sarwan Ali ∗ Abstract. Biological classification with interpretability remains a challenging task. For this, we introduce a novel encoding framework, Multi-Scale Reversible Chaos Game Representation (MS-RCGR), that transforms biological sequences into multi-resolution geometric representations with guaranteed reversibility. Unlike traditional sequence encoding methods, MSRCGR employs rational arithmetic and hierarchical kmer decomposition to generate scale-invariant features that preserve complete sequence information while enabling diverse analytical approaches. Our framework bridges three distinct paradigms for sequence analysis: (1) traditional machine learning using extracted geometric features, (2) computer vision models operating on CGR-generated images, and (3) hybrid approaches combining protein language model embeddings with CGR features. Through comprehensive experiments on synthetic DNA and protein datasets encompassing seven distinct sequence classes, we demonstrate that MS-RCGR features consistently enhance classification performance across all paradigms. Notably, our hybrid approach combining pre-trained language model embeddings (ESM2, ProtT5) with MS-RCGR features achieves superior performance compared to either method alone. The reversibility property of our encoding ensures no information loss during transformation, while multi-scale analysis captures patterns ranging from individual nucleotides to complex motif structures. Our results indicate that MS-RCGR provides a flexible, interpretable, and high-performing foundation for biological sequence analysis. 1 Introduction. Biological sequence classification underpins a wide range of tasks in computational biology, including functional annotation of proteins, taxonomic assignment of metagenomic reads, and detection of repetitive genomic elements [11, 10]. The central challenge is to construct representations that are simultaneously information-preserving, computationally ∗ Columbia University, NY, USA ([email protected]). † Department of Computer Science, Institute of Business Administration Karachi, Pakistan ([email protected]).
Taslim Murad † tractable, and discriminative across biologically meaningful sequence classes. Classical and combinatorial approaches often represent biological sequences using engineered feature spaces, such as k-mer frequency profiles [12, 17] or features derived from sequence alignment [3]. These representations enable the application of standard machine learning classifiers. However, k-mer–based methods typically ignore positional dependencies between symbols and produce high-dimensional feature spaces whose size grows exponentially with k, leading to scalability challenges [23]. While alignment-based representations preserve sequence order, they are computationally expensive and difficult to scale to large datasets [20, 24]. An orthogonal line of work employs the Chaos Game Representation (CGR) [9], which embeds a sequence as a fractal point cloud in the unit square, thereby encoding both composition and long-range order in a compact spatial format. However, standard CGR is restricted to four-symbol alphabets, is sensitive to floating-point accumulation, and is not trivially reversible over large protein alphabets. More recently, pre-trained protein language models (pLMs) such as ESM-2 [14], ProtTrans [8], and ProteinBERT [4] have demonstrated state-of-the-art performance on numerous protein function and structure prediction benchmarks by learning evolutionary context from hundreds of millions of sequences. Yet pLM embeddings alone encode global evolutionary context and may miss fine-grained local compositional signals that are critical for classifying sequences by physicochemical class or nucleotide composition. In this work we propose a Multi-Scale Reversible Chaos Game Representation (MS-RCGR) that addresses the limitations of prior CGR methods: it handles arbitrary alphabets via a rational-arithmetic corner-point scheme, guarantees exact sequence reconstruction, and captures multi-resolution compositional patterns through k-mer streams at scales K = {1, 2, 3, 4}. We then fuse the resulting compact structural descriptors with mean-pooled ESM-2 embeddings and evaluate all combinations on a 7-class synthetic benchmark spanning four DNA composition classes and
Copyright © 20XX by SIAM Unauthorized reproduction of this article is prohibited
three protein physicochemical classes. Our main findings are: (1) pLM embeddings alone (SVM-ESM2, 98.71% accuracy) substantially outperform both k-mer baselines (LR-kmer, 92.86%) and CGR image-based deep learning pipelines (custom CNN, 63.71%), confirming that pre-trained evolutionary context is the dominant discriminative signal; (2) CGR features provide complementary geometric information that, when fused with ESM-2 embeddings, maintains competitive accuracy (SVM-ESM2+CGR, 98.94%); and (3) the MS-RCGR encoding is provably reversible, making it applicable wherever lossless representation is required. Contributions. • A formal multi-scale extension of CGR to arbitrary alphabets with rational-arithmetic precision guarantees and a proof of exact reconstruction (Theorem 3.1). • A systematic comparison of four representation paradigms (k-mer features, CGR structural features, CGR image-based deep learning, and pLM embeddings) under a unified experimental protocol. • Empirical evidence that additive fusion of compact CGR descriptors with pLM embeddings preserves accuracy while reducing dependence on model size. 2 Related Work. Chaos Game Representation. CGR was introduced by Jeffrey [9] as a visualisation tool for DNA sequences and later formalised as a bijective mapping from sequences to the unit square by Almeida et al. [2], who showed that the CGR image of a sequence of length n encodes the complete k-mer frequency spectrum for all k ≤ n. Variant approaches include the Frequency Matrix CGR (FCGR) [7], which bins the CGR point cloud into a 2k ×2k density matrix equivalent to the k-mer profile, and multifractal CGR [22], which extracts fractaldimension features for phylogenetic analysis. Our MSRCGR generalises these constructions to m-symbol alphabets via rational arithmetic and adds a multi-scale k-mer stream formulation not present in prior work. k-mer and alignment-based sequence features. The spectrum kernel of Leslie et al. [12] defines an inner product over k-mer occurrence counts and achieves competitive results on remote homology detection. Profilebased features derived from PSI-BLAST positionspecific scoring matrices [17] encode evolutionary information in a fixed-length vector and remain strong baselines for protein classification. Unlike these methods, which are purely compositional, CGR-derived features
additionally encode positional ordering through the geometry of the fractal trajectory. Deep learning on sequence images. Convolutional neural networks applied directly to CGR images have been explored for genome classification [16], with reported accuracies in the range of 75–92% on curated benchmarks. Our experiments confirm that such vision pipelines underperform on the present benchmark (best 63.71%), likely because the sequences are too short (≤201 nt / 150 aa) to produce discriminative fractal structure in a 256 × 256 image. Protein language models. Transformer-based pLMs pre-trained on large sequence databases have rapidly become the dominant paradigm for protein representation learning. ESM-1b and ESM-2 [14] are trained with a masked language modelling objective on UniRef50 and achieve state-of-the-art results on structure prediction, mutation effect estimation, and functional classification. ProtTrans [8] trains T5 and BERT variants on the BFD/UniRef databases and produces per-residue embeddings used across secondary structure, localisation, and homology tasks. ProteinBERT [4] combines a BERT-style encoder with a global annotation track for joint sequence-function pre-training. Our work differs from these in that we use pLM embeddings as a fixed feature extractor rather than fine-tuning, and we study their interaction with explicit geometric CGR features. Multimodal and hybrid sequence representations. Hybrid approaches combining handcrafted features with learned embeddings have been proposed for nucleotidelevel tasks: iLearn [6] and iFeature [5] provide unified pipelines for k-mer, pseudo-amino-acid composition, and structural features. BioSeq-Analysis [15] extends this to RNA and DNA with ensemble classifiers. Our contribution advances this direction by (i) using modern large-scale pLMs, (ii) providing a reversibility guarantee, and (iii) conducting a controlled ablation of each representation component. 3 Proposed Approach. We present a multiphase framework for biological sequence classification that combines a novel Multi-Scale Reversible Chaos Game Representation (MS-RCGR) with protein language model embeddings. The framework operates in three stages: (1) rational-arithmetic CGR encoding at multiple scales, (2) extraction of structural CGR features, and (3) fusion with pre-trained protein language model (pLM) embeddings for downstream classification. 3.1 Multi-Scale Reversible CGR Encoding Corner-point generation. Let Σ be a biological alphabet of size |Σ| = m (e.g. the 20 amino acids or 4 DNA bases). We assign each symbol ai ∈ Σ a corner point in R2 via rational arithmetic. Let q = 2⌈log2 (4m)⌉ . Copyright © 20XX by SIAM Unauthorized reproduction of this article is prohibited
Define (3.1) ci =
2πi ∈ Q2 , roundq cos 2πi , round sin q m m i = 0, . . . , m − 1,
For k > 1, reconstruction proceeds by recovering the k-mer sequence from the trajectory and then reassembling the original sequence from the overlapping kmers via the greedy overlap-extension algorithm, which succeeds whenever the k-mers form a (possibly nonEulerian) path in the de Bruijn graph of s.
3.3 Feature Extraction from MS-RCGR For each scale k ∈ K we extract a fixed-dimensional (k) (k) (k) where roundq (x) = ⌊qx⌋/q projects a real value onto descriptor from the trajectory E (s) = (p0 , . . . , pnk ) the q-grid. Storing ci as fractions with denominator where nk = n − k + 1: bounded by B (the precision bound ) eliminates floating(3.4) point drift along arbitrarily long sequences. (k) (k) ¯(k) (k) ∗ ϕ(k) (s) = ⟨p(k) ⟩ ∈ R6 CGR map. Given a sequence s = s1 s2 · · · sn ∈ Σ , nk ,x , pnk ,y , nk , Varx , Vary , d the CGR trajectory is the iterative midpoint process (k) where Var(k) x and Vary are the empirical variances (3.2) (k) p0 = (0, 0), pt = 12 pt−1 + cσ(st ) , t = 1, . . . , n, of the x- and y-coordinates of the trajectory, and d = P (k) nk 1 t=1 ∥pt ∥2 is the mean distance from the origin. nk where σ : Σ → {0, . . . , m − 1} is the symbol index. All Concatenating over all scales gives the CGR feature arithmetic in (3.2) is carried out over Q with denomi- vector nators bounded by B, ensuring exact representations. Multi-scale extension. To capture compositional (3.5) h i patterns at different resolutions, we apply the CGR ΦCGR (s) = ϕ(1) (s) ∥ ϕ(2) (s) ∥ ϕ(3) (s) ∥ ϕ(4) (s) ∈ R24 map not to the raw symbol stream but to sliding k-mer windows. For scale k ≥ 1, define the k-mer sequence 3.4 Protein Language Model Embeddings (k) (k) (k) w(k) = (w1 , . . . , wn−k+1 ) where wt = st · · · st+k−1 . We augment the CGR-derived features with contextEach unique k-mer is deterministically mapped to an al- aware representations from pre-trained pLMs. Specifphabet symbol via a canonical ordering, and the CGR ically, we employ ESM-2 [14] (6-layer, 8M-parameter map (3.2) is applied to the resulting symbol stream. variant) and ProteinBERT [4]. For a sequence s of The multi-scale encoding of s is length n, the ESM-2 encoder produces per-residue hid(3.3)
E(s) =
E (k) (s) k∈K ,
where K = {1, 2, 3, 4} in our experiments, and E (k) (s) denotes the trajectory (3.2) computed on the k-mer stream.
den states H = [h1 , . . . , hn ] ∈ Rn×d ; we aggregate via mean pooling n
(3.6)
ΦpLM (s) =
1X ht ∈ Rd , n t=1
with d = 320 for ESM-2. Sequences are truncated to 3.2 Reversibility A key property of our encod- 512 tokens prior to embedding. ing is exact reversibility: the original sequence can be 3.5 Feature Fusion and Classification We recovered from any single-scale trajectory without loss. evaluate two feature regimes: (i) pLM only, using Theorem 3.1 (Perfect Reconstruction). Let s ∈ Φ pLM alone, and (ii) pLM+CGR, using the concateΣn , k = 1, and B ≥ 2n+1 . Given the trajectory nated vector (p0 , p1 , . . . , pn ) produced by (3.2), the map ϕ : pt 7→ st (3.7) Φ(s) = ΦpLM (s) ∥ ΦCGR (s) ∈ Rd+20 . is well-defined and computable in O(n) time. Pt Proof. From (3.2), pt = j=1 2−(t−j+1) cσ(sj ) . For Both representations are z-score normalised before bescale k = 1 the corners {ci } are distinct rational ing fed to classifiers. Three standard classifiers are evalpoints by (3.1) and the spacing is Ω(q −1 ). Given pt , uated: Support Vector Machine (RBF kernel), Logisrearranging gives cσ(st ) = 2pt − pt−1 , which identifies st tic Regression (ℓ2 -regularised), and Random Forest (100 uniquely because no two corners coincide. Applying this trees). step for t = n, n−1, . . . , 1 (with p0 = 0 known) recovers Algorithm 3.1 summarises the complete pipeline. The s in O(n) operations. The denominator of pt is at most CGR encoding steps run in O(|K| · n) time and 2t ≤ 2n ; hence B ≥ 2n+1 suffices to represent every pt O(n log B)-bit space; pLM inference dominates the overall cost at O(n2 ) attention complexity per layer. exactly. Copyright © 20XX by SIAM Unauthorized reproduction of this article is prohibited
Algorithm 3.1 MS-RCGR Feature Extraction and Classification Require: Sequence s ∈ Σ∗ ; scales K; pLM encoder fθ ; precision bound B; classifier g Ensure: Predicted class label ŷ m−1 1: Compute corner points {ci }i=0 via (3.1) 2: ΦCGR (s) ← 020 3: for k ∈ K do 4: Compute k-mer stream w(k) from s 5: Run CGR map (3.2) over w(k) using rational arithmetic with bound B 6: ϕ(k) (s) ← extract descriptor via (3.4) 7: Concatenate ϕ(k) (s) into ΦCGR (s) 8: end for 9: Obtain ΦpLM (s) = fθ (s) via mean-pooled pLM hidden states (3.6) Figure 3.1: MS-RCGR-based Representation of the 10: Φ(s) ← [ΦpLM (s) ∥ ΦCGR (s)] example DNA sequence ATCGATCGTAGC at scale k = 11: Normalise Φ(s) to zero mean and unit variance 1. Corner points for nucleotides A, T, G, and C 12: ŷ ← g Φ(s) are placed on the unit circle via rational-arithmetic 13: trigonometric assignment (Eq. 3.1). The trajectory is 14: return ŷ initiated at the origin p0 = (0, 0) and each successive point pt is computed as the midpoint between pt−1 and the corner of the current nucleotide (Eq. 3.2). Figure 3.1 illustrates the scale k = 1 CGR tra- Points are coloured by their corresponding nucleotide, jectory for the sequence ATCGATCGTAGC, demonstrating and progressive darkening of trajectory edges reflects the geometric encoding principle underlying MS-RCGR. sequence order. Each nucleotide is assigned a corner point on the unit circle via rational-arithmetic projection (Eq. 3.1), and the iterative midpoint process (Eq. 3.2) produces a trajectory whose spatial distribution reflects both the com- 11 and 10 points respectively, while the geometric strucpositional content and the ordering of the sequence. No- ture shifts to encode di-mer and tri-mer co-occurrence tably, trajectory points cluster geometrically toward the patterns, capturing short-range sequential dependencies corners of their corresponding nucleotides, points near invisible at k = 1. At k = 4 (Figure 3.2d), only 9 A are red, near T are blue, and so on, such that a se- points remain, encoding the distribution of 4-mer moquence with biased composition (e.g. AT-rich) would tifs and reflecting the longest-range local context capproduce a trajectory visibly skewed toward those cor- tured by our framework. Critically, the final position ⋆ ners. This geometric structure is precisely what MS- and the trajectory variance differ substantially across RCGR exploits: the final position, trajectory variance, scales, confirming that each scale contributes geometriand mean displacement from the origin (Eq. 3.4) en- cally distinct information to the concatenated descriptor 24 code distributional and positional signals that are ab- ΦCGR (s) ∈ R (Eq. 3.5). This multi-resolution decomsent from purely compositional k-mer frequency vectors. position is the key advantage of MS-RCGR over stanCritically, since no two corner points coincide under the dard single-scale CGR, enabling the downstream classirational construction, the original sequence can be re- fier to exploit compositional signals at multiple levels of covered exactly from the trajectory via the reconstruc- sequence granularity simultaneously. Figure 3.3 visualises the complete 24-dimensional tion map φ : pt 7→ st (Theorem 3.1), guaranteeing lossdescriptor ΦCGR (s) extracted from ATCGATCGTAGC. less representation. Figure 3.2 illustrates how the CGR trajectory Each scale contributes a six-dimensional block enevolves across the four scales of MS-RCGR for the se- coding the two-dimensional final trajectory position (k) quence ATCGATCGTAGC. At k = 1 (Figure 3.2a), the tra- pnk , effective sequence length nk , coordinate variances (k) (k) jectory visits 12 points, one per nucleotide, and its spa- (Varx , Vary ), and mean displacement from the origin ¯ Two observations are immediately apparent. First, tial spread reflects the full single-residue composition of d. the sequence. As the scale increases to k = 2 and k = 3 the final position coordinates vary substantially across (Figures 3.2b–3.2c), the trajectory length contracts to scales, including sign changes at k = 1, confirming that Copyright © 20XX by SIAM Unauthorized reproduction of this article is prohibited
(a) Scale k = 1
(b) Scale k = 2
Figure 3.3: Normalised MS-RCGR feature vector ΦCGR (s) ∈ R24 extracted from the example sequence ATCGATCGTAGC across scales k ∈ {1, 2, 3, 4}. Each group of six bars corresponds to the per-scale descrip(k) (k) ¯(k) tor φ(k) (s) = ⟨pnk , nk , Var(k) ⟩ (Eq. 3.4), x , Vary , d (k)
where pnk denotes the two-dimensional final trajectory position. (c) Scale k = 3
(d) Scale k = 4
Figure 3.2: MS-RCGR trajectories for the example sequence ATCGATCGTAGC across scales k ∈ {1, 2, 3, 4}. Each trajectory is initiated at the origin × and progresses through nk = n − k + 1 points (indicated in each panel), with edge opacity encoding temporal order. The (k) star marker (⋆) denotes the final position pnk , which forms the first component of the per-scale descriptor φ(k) (s) (Eq. 3.4). As k increases, k-mer tokenisation reduces the effective sequence length and maps overlapping windows onto a coarser alphabet, producing trajectories with fewer but geometrically distinct points that capture progressively longer-range compositional patterns.
transformer with attention truncated to length n. Proof. For each scale k, generating the k-mer stream and executing the CGR loop each take O(n) steps, giving O(|K| · n) for all scales. Descriptor extraction (3.4) takes O(n) per scale. Mean-pooled pLM inference on a sequence of length min(n, 512) requires O(L · n2 ) operations for self-attention plus O(L · n · d) for feed-forward layers; the self-attention term dominates for d ≪ n. Classifier evaluation on the resulting O(d)-dimensional vector is O(d). Summing these terms yields the stated bound.
4 Experimental Setup. To systematically assess the utility of MS-RCGR across diverse analytical settings, we design a controlled benchmark spanning four representation paradigms: classical k-mer feaeach scale captures geometrically distinct positional in- tures, MS-RCGR structural descriptors, CGR imageformation. Second, the variance and mean displace- based deep learning, and protein language model emment features grow systematically with k, reflecting the beddings, both with and without MS-RCGR augmentabroader spatial spread of trajectories over coarser k-mer tion. All paradigms are evaluated on the same synthetic alphabets as seen in Figure 3.2. Together, these ob- seven-class dataset under an identical train/test protoservations demonstrate that the four scale blocks are col, enabling direct, fair comparison across methods. non-redundant: each encodes a complementary view of 4.1 Dataset We evaluate on a synthetic benchsequence composition and local ordering, justifying the mark comprising seven balanced sequence classes: four concatenation scheme of Eq. 3.5 and explaining the ad- DNA composition classes and three protein physicoditive benefit of ΦCGR when fused with pLM embed- chemical classes, with 1,000 sequences per class (7,000 dings. sequences total). DNA sequences of length 50–201 nt are drawn from four compositional regimes: uniform 3.6 Complexity Analysis random (p(A) = p(T) = p(G) = p(C) = 0.25), ATProposition 3.2. The total feature extraction time rich (p(A) = p(T) = 0.40, p(G) = p(C) = 0.10), for a sequence of length n with |K| scales is Θ(|K| · n + GC-rich (p(G) = p(C) = 0.40, p(A) = p(T) = 0.10), TpLM (n)), where TpLM (n) = O(L · n2 ) for an L-layer and repetitive (tiled from randomly selected 4-mer moCopyright © 20XX by SIAM Unauthorized reproduction of this article is prohibited
tifs with stochastic truncation). Protein sequences of length 30–150 aa are drawn from three physicochemical regimes: hydrophobic-rich (64% hydrophobic residues), hydrophilic-rich (72% charged/polar residues), and mixed (uniform over the 20-residue alphabet). The full dataset is partitioned into training and test sets using a stratified 80/20 split. 4.2 Representation Paradigms We evaluate four complementary representation paradigms under a unified experimental protocol. k-mer features. Sequences are featurised using tri-mer (k = 3) frequency profiles extracted via a count vectoriser, yielding sparse compositional vectors that serve as the classical baseline. MS-RCGR structural features. For each sequence, the MS-RCGR encoder (Section 3) is applied at scales K = {1, 2, 3, 4}, producing the 24-dimensional descriptor ΦCGR (s) ∈ R24 (Eq. 3.5). DNA sequences use the 4-symbol alphabet; protein sequences use the standard 20-symbol amino acid alphabet. CGR image-based deep learning. The scale-1 CGR trajectory is rasterised into a 256 × 256 RGB image, resized to 224×224, and normalised with ImageNet statistics prior to input into vision models. Protein language model embeddings. Sequences are embedded using ESM-2 [13] (esm2_t6_8M_UR50D, d = 320) and ProteinBERT [4], with mean pooling over per-residue hidden states (Eq. 6). DNA sequences are mapped to the protein alphabet prior to pLM inference to maintain compatibility with models pre-trained on protein corpora. All embeddings are truncated to a maximum of 512 tokens. Other Baselines. We also compare our model with traditional baselines, including String Kernel [1], WDGRL [19], Autoencoder [21], and TAPE [18]. 4.3 Classifiers and Training For feature-based paradigms (k-mer, MS-RCGR, pLM, and their fusions), three classifiers are evaluated: Support Vector Machine with RBF kernel (SVM), ℓ2 -regularised Logistic Regression (LR), and Random Forest with 100 trees (RF). All feature vectors are z-score normalised prior to classifier training. For the image-based paradigm, four architectures are trained end-to-end: ResNet-18, VGG-16, and DenseNet-121 (ImageNet pre-trained with task-specific output heads), and a custom four-block CNN trained from scratch. All vision models are optimised with Adam (η = 10−3 ) using cross-entropy loss over 20 epochs, with a step learning rate schedule (decay factor 0.1 every 10 epochs) and a batch size of 32. 4.4 Evaluation Protocol All models are evaluated on the held-out test set using weighted accuracy,
F1-score, precision, and recall to account for the balanced class distribution. 5 Results and Discussion. Table 5.1 summarises the best-performing model from each paradigm; detailed breakdowns appear in Tables 5.2–5.5. Traditional ML with k-mer features. Among classical baselines, Logistic Regression with k-mer features (LR_kmer) achieves the highest accuracy of 92.86% (Table 5.2), outperforming both Random Forest (89.93%) and SVM (90.93%). While competitive, these purely compositional representations discard positional ordering and serve as a lower bound for methods that exploit richer structural information. Vision models on CGR images. Applying convolutional architectures directly to CGR images yields substantially weaker results (Table 5.3), with the best performer, a custom CNN, reaching only 63.71%. Standard pretrained architectures (ResNet-18, DenseNet121) achieve similar scores, while VGG-16 collapses to majority-class prediction. This degradation is consistent with the observation that sequences in our benchmark ( ≤201 nt / 150 aa) are too short to produce discriminative fractal structure at 256×256 resolution, confirming that raw image rendering is an insufficient use of the geometric information encoded by CGR. VGG-16’s unique collapse can be attributed to its purely sequential deep architecture, which lacks the residual and dense skip connections present in ResNet-18 and DenseNet121; without these stabilizing pathways, gradient flow degenerates when inputs carry near-zero spatial structure, driving the model to majority-class prediction. The additional mismatch between ImageNet-pretrained filters optimized for textures and edges and the sparse geometric point clouds produced by short sequences further compounds this failure. LLM embeddings alone. Mean-pooled ESM-2 embeddings paired with an RBF-SVM (SVM_ESM2) achieve 98.71% accuracy (Table 5.4), confirming that pre-trained evolutionary context is the dominant discriminative signal on this benchmark. ProteinBERT embeddings, by contrast, fail entirely (14.29%), likely due to sequence-length truncation and domain mismatch with the synthetic dataset; this underscores that pLM choice is non-trivial. MS-RCGR augmentation of LLM embeddings. The key result of this work is that appending the compact 24-dimensional MS-RCGR descriptor to ESM-2 embeddings (SVM_ESM2_CGR, Table 5.5) shows better accuracy (98.94%) while providing two practical advantages. First, the CGR features supply explicit, interpretable geometric summaries of local compositional structure that are absent from the pLM’s global context representation. Second, and most strikCopyright © 20XX by SIAM Unauthorized reproduction of this article is prohibited
Table 5.1: Summary of Best Performing Models Across Approaches Approach Traditional ML (K-mer) Vision Models (CGR) LLM Embeddings Only LLM Embeddings + CGR Features
Best Model
Accuracy
F1-Score
Precision
LR_kmer custom_cnn_vision SVM_ESM2 SVM_ESM2_CGR
0.9286 0.6371 0.9871 0.9894
0.9284 0.6268 0.9872 0.9865
0.9283 0.6245 0.9873 0.9866
Table 5.2: Performance of Traditional Machine Learning Models with K-mer Features Model RF_kmer SVM_kmer LR_kmer
Accuracy
F1-Score
Precision
Recall
0.8993 0.9093 0.9286
0.8930 0.9094 0.9284
0.8983 0.9108 0.9283
0.8993 0.9093 0.9286
ingly, augmenting the otherwise-failing ProteinBERT embeddings with MS-RCGR features raises accuracy from 14.29% to 70.29% (LR_ProteinBERT_CGR), a gain of over 56 percentage points. This dramatic recovery demonstrates that MS-RCGR features encode information that is genuinely complementary to, and partially compensatory for, deficiencies in the underlying language model—a property that purely compositional k-mer vectors cannot replicate. Table 5.5: Performance of Models Using LLM Embeddings Combined with CGR Features
Best: LR_kmer (Accuracy: 0.9286)
Model
Table 5.3: Performance of Vision Models with CGR Images Model
Accuracy
F1-Score
Precision
Recall
0.6164 0.1429 0.6043 0.6371
0.6142 0.0357 0.5975 0.6268
0.6141 0.0204 0.6082 0.6245
0.6164 0.1429 0.6043 0.6371
Accuracy
F1-Score
Precision
Recall
0.9807 0.9871 0.9857 0.1429 0.1429 0.1429
0.9808 0.9872 0.9858 0.0357 0.0357 0.0357
0.9809 0.9873 0.9859 0.0204 0.0204 0.0204
0.9807 0.9871 0.9857 0.1429 0.1429 0.1429
RF_ESM2_CGR SVM_ESM2_CGR LR_ESM2_CGR RF_ProteinBERT_CGR SVM_ProteinBERT_CGR LR_ProteinBERT_CGR
Accuracy
F1-Score
Precision
Recall
0.9814 0.9894 0.9843 0.6893 0.6843 0.7029
0.9815 0.9865 0.9843 0.6912 0.6857 0.7006
0.9818 0.9866 0.9845 0.6940 0.6873 0.6991
0.9814 0.9894 0.9843 0.6893 0.6843 0.7029
Best: SVM_ESM2_CGR (Accuracy: 0.9894)
Overall takeaways. Across all four paradigms, MS-RCGR consistently adds value: it closes the gap between a weak pLM and a strong one, and it maintains competitive accuracy when fused with the best available Best: custom_cnn_vision (Accuracy: 0.6371) embeddings. Combined with its provable losslessness (Theorem 3.1) and O(|K| · n) encoding cost (Proposition 1), these results position MS-RCGR as a lightweight, interpretable, and broadly applicable augmentation layer for biological sequence analysis pipelines. To further evaluate the proposed model, we compare the results of our best model with traditional baseTable 5.4: Performance of Models Using LLM Embed- lines. Table 5.6 shows the detailed results comparisons, where we can observe that our model outperforms all dings Only the baselines significantly. resnet18_vision vgg16_vision densenet121_vision custom_cnn_vision
Model RF_ESM2 SVM_ESM2 LR_ESM2 RF_ProteinBERT SVM_ProteinBERT LR_ProteinBERT
Best: SVM_ESM2 (Accuracy: 0.9871)
Table 5.6: Comparison with the baselines Model
Accuracy
F1-Score
Precision
String Kernel
0.9159
0.9201
0.9213
Recall 0.9159
WDGRL
0.9297
0.9315
0.9346
0.9297
Autoencoder
0.8974
0.8996
0.8999
0.8974
TAPE
0.8743
0.8791
0.8803
0.8743
SVM_ESM2_CGR (ours)
0.9894
0.9865
0.9866
0.9894
Copyright © 20XX by SIAM Unauthorized reproduction of this article is prohibited
6 Conclusion. We presented MS-RCGR, a multi-scale, reversible chaos game representation framework for biological sequence classification that is provably lossless, alphabet-agnostic, and computable in linear time. Across four representation paradigms evaluated on a seven-class benchmark, MS-RCGR features consistently provided complementary geometric information that enhanced classification performance— most strikingly recovering over 56 percentage points of accuracy when paired with a weak protein language model, and sustaining near-identical accuracy (98.94%) when fused with the state-of-the-art ESM-2 embeddings. These results establish MS-RCGR as a lightweight, interpretable, and broadly applicable augmentation layer that strengthens any sequence analysis pipeline regardless of the underlying model’s capacity, with natural extensions to genomics, proteomics, and drug discovery. References
modeling of dna, rna and protein sequence data, Briefings in bioinformatics, 21 (2020), pp. 1047– 1057. [7] P. J. Deschavanne, A. Giron, J. Vilain, G. Fagot, and B. Fertil, Genomic signature: characterization and classification of species assessed by chaos game representation of sequences., Molecular biology and evolution, 16 (1999), pp. 1391–1399. [8] A. Elnaggar, M. Heinzinger, C. Dallago, G. Rehawi, Y. Wang, L. Jones, T. Gibbs, T. Feher, C. Angerer, M. Steinegger, et al., Prottrans: toward understanding the language of life through self-supervised learning, IEEE transactions on pattern analysis and machine intelligence, 44 (2021), pp. 7112–7127. [9] H. J. Jeffrey, Chaos game representation of gene structure, Nucleic acids research, 18 (1990), pp. 2163–2170.
[1] S. Ali, B. Sahoo, M. A. Khan, A. Zelikovsky, I. U. Khan, and M. Patterson, Efficient ap- [10] J. Jumper, R. Evans, A. Pritzel, T. Green, proximate kernel based spike sequence classificaM. Figurnov, O. Ronneberger, K. Tuntion, IEEE/ACM Transactions on Computational yasuvunakool, R. Bates, A. Žídek, Biology and Bioinformatics, (2022). A. Potapenko, et al., Highly accurate protein structure prediction with alphafold, nature, 596 [2] J. S. Almeida, J. A. Carrico, A. Maretzek, (2021), pp. 583–589. P. A. Noble, and M. Fletcher, Analysis of genomic sequences by chaos game representation, Bioinformatics, 17 (2001), pp. 429–437.
[11] Y. LeCun, Y. Bengio, and G. Hinton, Deep learning, nature, 521 (2015), pp. 436–444.
[3] S. F. Altschul, T. L. Madden, A. A. Schäf- [12] C. Leslie, E. Eskin, and W. S. Noble, The fer, J. Zhang, Z. Zhang, W. Miller, and spectrum kernel: A string kernel for svm protein D. J. Lipman, Gapped blast and psi-blast: a new classification, in Biocomputing 2002, World Sciengeneration of protein database search programs, tific, 2001, pp. 564–575. Nucleic acids research, 25 (1997), pp. 3389–3402. [13] Z. Lin, H. Akin, R. Rao, B. Hie, Z. Zhu, [4] N. Brandes, D. Ofer, Y. Peleg, N. RapW. Lu, N. Smetanin, A. dos Santos Costa, poport, and M. Linial, Proteinbert: a universal M. Fazel-Zarandi, T. Sercu, S. Candido, deep-learning model of protein sequence and funcet al., Language models of protein sequences at tion, Bioinformatics, 38 (2022), pp. 2102–2110. the scale of evolution enable accurate structure prediction, bioRxiv, (2022). [5] Z. Chen, P. Zhao, F. Li, A. Leier, T. T. Marquez-Lago, Y. Wang, G. I. Webb, A. I. [14] Z. Lin, H. Akin, R. Rao, B. Hie, Z. Zhu, Smith, R. J. Daly, K.-C. Chou, et al., ifeaW. Lu, N. Smetanin, R. Verkuil, O. Kabeli, ture: a python package and web server for feaY. Shmueli, et al., Evolutionary-scale prediction tures extraction and selection from protein and pepof atomic-level protein structure with a language tide sequences, Bioinformatics, 34 (2018), pp. 2499– model, Science, 379 (2023), pp. 1123–1130. 2502. [15] B. Liu, X. Gao, and H. Zhang, Bioseq[6] Z. Chen, P. Zhao, F. Li, T. T. Marquezanalysis2. 0: an updated platform for analyzLago, A. Leier, J. Revote, Y. Zhu, D. R. ing dna, rna and protein sequences at sequence Powell, T. Akutsu, G. I. Webb, et al., level and residue level based on machine learnilearn: an integrated platform and meta-learner for ing approaches, Nucleic acids research, 47 (2019), feature engineering, machine-learning analysis and pp. e127–e127. Copyright © 20XX by SIAM Unauthorized reproduction of this article is prohibited
[16] H. F. Löchel, D. Eger, T. Sperlea, and D. Heider, Deep learning on chaos game representation for proteins, Bioinformatics, 36 (2020), pp. 272–279. [17] H. Rangwala and G. Karypis, Profile-based direct kernels for remote homology detection and fold recognition, Bioinformatics, 21 (2005), pp. 4239– 4247. [18] R. Rao, N. Bhattacharya, N. Thomas, Y. Duan, P. Chen, J. Canny, P. Abbeel, and Y. Song, Evaluating protein transfer learning with tape, Advances in neural information processing systems, 32 (2019). [19] J. Shen, Y. Qu, et al., Wasserstein distance guided representation learning for domain adaptation, in AAAI conference on artificial intelligence, 2018. [20] D. E. Wood and S. L. Salzberg, Kraken: ultrafast metagenomic sequence classification using exact alignments, Genome biology, 15 (2014), p. R46. [21] J. Xie, R. Girshick, and A. Farhadi, Unsupervised deep embedding for clustering analysis, in International conference on machine learning, 2016, pp. 478–487. [22] Z.-G. Yu, V. Anh, and K.-S. Lau, Chaos game representation of protein sequences based on the detailed hp model and their multifractal and correlation analyses, Journal of theoretical biology, 226 (2004), pp. 341–348. [23] H. Zhang, Y. Shi, Y. Wang, X. Yang, K. Li, S.-K. Im, and Y. Han, Biological sequence representation methods and recent advances: A review, Biology, 14 (2025), p. 1137. [24] A. Zielezinski, S. Vinga, J. Almeida, and W. M. Karlowski, Alignment-free sequence comparison: benefits, applications, and tools, Genome biology, 18 (2017), p. 186.
Copyright © 20XX by SIAM Unauthorized reproduction of this article is prohibited