Reverse-CGR: Reversible CGR for Sequence Recovery
- Reverse-CGR is a reversible formulation of chaos game representation that preserves complete sequence information through geometric encoding.
- It employs two primary strategies—explicit-path storage and rational-trajectory computation—to enable exact inversion of traditional, irreversible CGR.
- Extensions like MS-RCGR and FCGR reconstruction integrate multi-scale analysis and k-mer statistics, boosting classification and visualization in bioinformatics.
Reverse-CGR (R-CGR) denotes a set of reversible formulations of Chaos Game Representation for biological sequences. Across recent arXiv literature, the term is used for exact sequence recovery from stored CGR traces, for formal inversion of rational CGR trajectories, and for reconstruction of sequences from Frequency CGR (FCGR) or -mer statistics. In each case, the central objective is to remove the irreversibility of traditional CGR while retaining geometric structure suitable for visualization, feature extraction, and learning (Ali, 22 Sep 2025, Ali et al., 20 Apr 2026, He et al., 27 Jun 2025).
1. Conceptual basis and relation to classical CGR
Classical CGR maps a symbolic sequence to a geometric trace in the unit square, or more generally to corner points assigned to alphabet symbols, by iteratively moving toward the corner associated with the current symbol. In the reversible formulations, the same basic update is retained:
with initialization at , where maps a symbol to its corner index and is the corresponding corner (Ali et al., 20 Apr 2026).
The motivation for R-CGR is the irreversibility of standard CGR. Traditional CGR is described as losing the capacity to reconstruct the original sequence from the geometric path; character order and identity are not retrievable once the sequence has been mapped. The literature also identifies practical reasons for this failure: floating-point error accumulates during iteration, exact inversion is hindered, and the difficulty is amplified for larger alphabets such as proteins with symbols (Ali, 22 Sep 2025, Ali et al., 20 Apr 2026).
This motivates a shift from purely geometric encoding to information-preserving geometric encoding. A plausible implication is that reversibility in this setting is not merely a decoding convenience but a design constraint that changes how corners are assigned, how coordinates are stored, and what auxiliary information is retained.
2. Exact reversibility from geometric trajectories
Two closely related but technically distinct reversible constructions appear in the literature. One stores the complete path explicitly. The other proves that exact inversion is possible from the rational trajectory itself.
In the explicit-path formulation, R-CGR augments CGR by storing the entire path trace. At each step, the representation records the current character , the previous position , the new position , and the corner point associated with 0. The trace is
1
and reconstruction is obtained by reading the stored characters in order; this yields exact recovery because character and positional information are preserved stepwise (Ali, 22 Sep 2025).
A second line of work constructs exact reversibility without storing the character stream separately. The corner set is placed on a rational grid:
2
with 3. Because the corners are distinct rationals and all arithmetic is exact, the inverse step is
4
The stated theorem gives perfect reconstruction for 5: if 6, the trajectory 7 is given, and 8, then the sequence can be recovered in 9 time by computing each corner from adjacent points and mapping it back to its unique symbol (Ali et al., 20 Apr 2026).
| Formulation | Given representation | Recovery mechanism |
|---|---|---|
| Explicit-path R-CGR | Final point plus path trace 0 | Concatenate stored symbols in order |
| Rational-trajectory Reverse-CGR | Exact trajectory 1 | Compute 2 and identify the corner |
For 3, the rational inverse is applied to the stream of 4-mers rather than single symbols; the full sequence is then reconstructed by concatenating overlapping 5-mers through greedy overlap-extension. The literature states that this is always possible when the 6-mers form a path in the de Bruijn graph induced by the sequence (Ali et al., 20 Apr 2026).
3. Multi-scale reversible CGR and hierarchical encoding
The multi-scale extension, termed Multi-Scale Reversible Chaos Game Representation (MS-RCGR), generalizes reversible CGR from single symbols to hierarchical 7-mer streams. For each scale 8, one defines
9
maps each unique 0-mer deterministically to a symbol, and applies the same rational CGR process to that stream. The resulting multi-scale encoding is
1
The description in the source states that this permits patterns ranging from individual nucleotides to motif structures of length 2 to be jointly and losslessly represented (Ali et al., 20 Apr 2026).
MS-RCGR is presented as a unified framework spanning three analytical paradigms: traditional machine learning using extracted geometric features, computer vision models operating on CGR-generated images, and hybrid approaches combining protein LLM embeddings with CGR features. The reversibility property is used here as a guarantee that the transformation preserves complete sequence information rather than discarding it for feature convenience alone (Ali et al., 20 Apr 2026).
This suggests a broader interpretation of Reverse-CGR: not only as a decoder, but as an encoding discipline in which reversibility is maintained across scales, alphabets, and downstream model families.
4. Reconstruction from FCGR and 3-mer statistics
A different use of “Reverse-CGR” appears in reconstruction from FCGR images or 4-mer frequency vectors. In that setting, the central result is that the FCGR of order 5 is mathematically equivalent to the 6-mer frequency vector of the sequence, and that FCGR arises by discretizing CGR at resolution 7. For a sequence 8 and a 9-mer 0, the source states
1
This establishes a bijective mapping between FCGR grid indices and 2-mers (He et al., 27 Jun 2025).
The associated reconstruction procedure uses a de Bruijn multigraph. Vertices are the observed 3-mers. Each 4-mer 5 becomes a directed edge from 6 to 7 with multiplicity equal to its target count 8. Reconstruction then proceeds by finding an Eulerian trail or cycle whose traversal emits a DNA sequence with the desired overlapping 9-mer composition. The marginal constraint is
0
for each 1-mer vertex 2, except for possible start and end vertices in the linear case (He et al., 27 Jun 2025).
When exact balance is absent, the method adds the minimum number of artificial edges, or equivalently short 3-mer walks, to restore Eulerian feasibility. Given a target frequency profile 4 and sequence length 5, integer counts are formed as
6
and the paper states the following error guarantee:
7
provided
8
This version of Reverse-CGR therefore reconstructs a sequence matching the prescribed 9-mer statistics with bounded error, rather than necessarily recovering the unique original sequence (He et al., 27 Jun 2025).
The same work also proves that symmetries of CGR images under the dihedral group 0 correspond to specific nucleotide permutations in the originating sequence. That result links image-level geometric operations to symbolic transformations of DNA and further clarifies the relationship between CGR geometry and sequence combinatorics (He et al., 27 Jun 2025).
5. Empirical performance and downstream use
Reversible CGR methods are used not only for reconstruction but also for classification and hybrid feature design. The explicit-path R-CGR paper evaluates 7-class synthetic biological sequence classification involving 4 DNA classes and 3 protein classes. The reported results include the following accuracy and F1 values (Ali, 22 Sep 2025):
| Model | Accuracy | F1 |
|---|---|---|
| R-CGR + VGG16 | 0.7907 | 0.7906 |
| R-CGR + Logistic Reg. | 0.7650 | 0.7670 |
| SeqVec | 0.7825 | 0.7784 |
| ESM2 | 0.7451 | 0.7418 |
| ProtT5 | 0.7348 | 0.7291 |
| Spike2CGR | 0.7575 | 0.7499 |
The same source states that R-CGR images with VGG16 outperform all baselines, and that even R-CGR with logistic regression exceeds sophisticated language-model baselines. The representation is described as generating feature-rich images suitable for deep learning while maintaining complete sequence information through explicit encoding (Ali, 22 Sep 2025).
MS-RCGR reports complementary empirical behavior. Across synthetic DNA and protein datasets containing seven distinct sequence classes, MS-RCGR features are said to consistently enhance classification performance across traditional machine learning, computer vision, and hybrid paradigms. In particular, the hybrid approach combining pre-trained LLM embeddings such as ESM2 and ProtT5 with MS-RCGR features is reported to achieve superior performance compared to either method alone (Ali et al., 20 Apr 2026).
These results position Reverse-CGR as both a reconstruction mechanism and a modeling substrate. The geometric representation can be rendered as images for CNNs, converted into extracted descriptors for conventional classifiers, or fused with protein LLM embeddings in hybrid systems.
6. Interpretability, storage, and terminological distinctions
Interpretability is a recurring motivation. The reversible encodings are presented as preserving direct links between geometric structure and sequence identity, enabling both machine analysis and human inspection. The explicit-path formulation describes position-aware coloring and feature-rich geometric traces, with DNA yielding square-patterned traces and proteins yielding intricate 20-sided polygon traces. Because the transformation is reversible, visual features can be related back to the underlying sequence rather than treated as anonymous image artifacts (Ali, 22 Sep 2025).
The explicit-path approach also gives a storage expression. If each step records the current character together with bounded-rational coordinates, total storage over 1 steps is stated as
2
The same source states that R-CGR cannot compress below the sequence entropy 3 without losing fidelity, matching Shannon’s theorem. This places a theoretical limit on how much reversibility can be achieved without storage overhead (Ali, 22 Sep 2025).
A common source of confusion is that “reversibility” is used in more than one sense. In the explicit-path variant, perfect reconstruction is guaranteed because the path trace stores the symbols themselves. In the rational-trajectory variant, perfect reconstruction follows from exact arithmetic, distinct corners, and access to the full trajectory. In the FCGR/4-mer setting, reconstruction refers to generating a sequence whose empirical 5-mer profile matches a target profile, with provable error bounds but not necessarily uniqueness of the recovered sequence (Ali et al., 20 Apr 2026, He et al., 27 Jun 2025).
Another common misconception is that classical CGR is already reversible. The cited literature states the opposite: traditional CGR loses sequence information during geometric mapping, and floating-point implementations introduce further irreversibility. Reverse-CGR is therefore best understood not as a minor implementation adjustment, but as a family of methods that redesign CGR around information preservation, exact arithmetic, or combinatorial reconstruction.