Source-linked AI summary
HiFiC-G: Adapting HiFiC for Hi-C Contact Matrices
Andre Antonio Straton
TL;DR
The paper asks whether HiFiC’s natural-image compression design can preserve biologically meaningful Hi-C structure under lossy compression. It adapts HiFiC with domain-informed losses and staged fine-tuning, finding better preservation of local structures but poor long-range compartment preservation linked to fixed-size tiling.
Problem
Hi-C compression requires preserving genomic structures used by downstream analyses, but perceptual image-quality objectives may discard subtle loops and TAD boundaries.
Method
HiFiC-G adapts a pretrained HiFiC checkpoint using a Hi-C pipeline, biologically weighted distortion, auxiliary TAD and compartment losses, and staged fine-tuning.
Results
Across two cell lines and two resolutions, HiFiC-G preserves stripes and TAD structure better than long-range A/B compartments, with the gap attributed to fixed-size tiling.
Takeaways & Limitations
Learned compression for Hi-C should optimize for genomic structure rather than visual appearance, because perceptual metrics do not reliably reflect biological preservation.
Takeaways & Limitations
Compartment preservation cannot yet be separated into tiling artifacts versus reconstruction failure without whole-chromosome or long-range-context evaluation.
Abstract
from arXiv · showhide
We study whether the loss design of High-Fidelity Generative Image Compression (HiFiC), a GAN-based neural codec originally built for natural photographs, can be adapted to preserve biologically meaningful structure in Hi-C chromatin contact maps under lossy compression. Standard image compression, including HiFiC in its original form, optimizes for human visual perception; but a Hi-C contact map is normally distributed together with its numeric matrix file (.cool/.mcool), which downstream genomic analysis tools consume directly. Aggressive compression that looks acceptable to the eye can nonetheless blur or delete loops and topologically associating domain (TAD) boundaries that these tools depend on. We modify HiFiC's distortion term with a spatially-weighted MSE that up-weights biologically salient regions (loops, TAD boundaries, stripes, compartment structure) and add an insulation-score loss term that directly penalizes loss of TAD boundary sharpness. We describe a three-phase fine-tuning strategy that adapts a pretrained HiFiC checkpoint to the Hi-C domain without catastrophic forgetting. We evaluate the resulting system, HiFiC-G, using both conventional image-quality metrics (PSNR, SSIM) and genomics-domain preservation metrics (loop/TAD/compartment/stripe preservation percentage) across two cell lines. HiFiC-G preserves local structure, meaning stripes and TAD boundaries, substantially better than the metrics alone would suggest, while long-range A/B compartment structure remains poorly preserved; we show this gap tracks genomic scale and is consistent with a specific architectural cause, the fixed-size tiling that both HiFiC-G and the original HiFiC rely on for memory efficiency.
1 Introduction
This work adapts generative image compression to Hi-C contact matrices by redefining preservation around biologically meaningful structure rather than visual similarity. It combines domain-specific objectives and evaluation metrics, while identifying fixed-size tiling as the main constraint on long-range structure preservation.
- Motivation: Hi-C compression must protect subtle loops and TAD boundaries that downstream genomic tools rely on, not only human-perceived image quality.Hi-C matrices are distributed as numeric .cool/.mcool files alongside heatmap images, serving computational and visual consumers differently.
- Approach: HiFiC-G adapts a GAN-based natural-image codec to Hi-C contact matrices through a staged fine-tuning procedure and domain-specific data pipeline.The adaptation addresses domain shift from natural images while attempting to avoid catastrophic forgetting.
- Approach: The training objectives up-weight biologically salient regions and add losses for TAD boundary sharpness and long-range compartment patterns.These objectives include spatially weighted distortion, insulation-score, and compartment-pattern losses.
- Evaluation: Evaluation combines conventional image metrics with structure-preservation metrics from two independently implemented detectors.The framework measures whether genomic structures are preserved rather than relying on pixel-level fidelity alone.
- Key finding: Fixed-size tiling limits long-range chromatin preservation, especially when genomic structures extend beyond an individual tile.The paper identifies tiling, rather than the loss design, as the limiting factor for long-range structure.
2 Related Work
Prior work established learned and GAN-based image compression, while Hi-C analysis provided structure callers that define biologically relevant evaluation targets. This project addresses the gap between those areas by adapting generative compression specifically for loop and TAD preservation.
- Learned compression: Learned compression jointly optimizes an autoencoder and entropy model under a rate-distortion trade-off, while GAN-based methods add a perception term.HiFiC extends this framework for generative compression and serves as the codebase for this work.
- Hi-C analysis: Hi-C analysis uses established tools for loop calling, TAD boundary calling, and reproducibility scoring between contact matrices.These tools provide domain-specific reference analyses for evaluating reconstructions.
- Research gap: The project targets an identified gap: adapting a generative image-compression GAN to preserve loop and TAD structure using a domain-informed distortion loss.The stated novelty concerns Hi-C-specific biological structure preservation under lossy compression.
3 Method
The original HiFiC objective jointly balances bitrate, pixel distortion, perceptual distortion, and adversarial realism. This multi-term objective provides the baseline that HiFiC-G modifies for Hi-C structure preservation.
- HiFiC objective: HiFiC trains an encoder, generator, entropy/hyperprior model, and conditional discriminator as a learned generative compression system.The encoder produces a latent representation, while the generator reconstructs the input and the entropy model estimates coding cost.
- HiFiC objective: The objective combines estimated bitrate, MSE distortion, LPIPS perceptual distortion, and an adversarial discriminator term.These terms jointly represent rate, reconstruction fidelity, perceptual similarity, and realism.
- HiFiC objective: Hyperparameters λ, kM, kP, and β control the trade-off among rate, distortion, and perceptual realism.The weighting coefficients determine the relative contribution of the objective’s components.
3.2 Weighted Distortion for Biological Salience
HiFiC-G replaces uniform pixel error with biologically weighted distortion and adds an insulation-score objective to preserve TAD boundary sharpness.
- Weighted distortion: The spatially weighted MSE emphasizes loops, TAD boundaries, stripes, compartment structure, and other biologically salient regions.The weight map is computed from each input tile before training, while LPIPS remains unweighted to preserve global visual coherence.
- Weighted distortion: Loops receive ×3.5 weight, corner peaks ×3.0, stripes and TAD boundaries ×2.5, and compartment structure ×1.8.The combined map is normalized to [0.1, 1.0], while void/background regions receive ×0.2.
- Insulation-score loss: The insulation-score loss targets blurred TAD boundaries by comparing diamond-window insulation profiles between original and reconstructed tiles.The current window averages 10 bins, approximately 250 kb at 25 kb resolution.
- Insulation-score loss: The full objective adds kI · Lins to the original HiFiC loss, with kI currently fixed at 0.1 relative to the main distortion terms.
3.4 Staged Domain Adaptation
HiFiC-G adapts a pretrained natural-image HiFiC checkpoint through staged fine-tuning, while its feature detectors use deliberately different heuristic and statistical criteria.
- Staged domain adaptation: HiFiC-G is fine-tuned from a pretrained natural-image checkpoint in three phases to reduce catastrophic forgetting under Hi-C statistics.
- Staged domain adaptation: Phase 1 updates only the input-facing encoder and generator convolutions, adapting Hi-C input/output statistics without disturbing internal representations.
- Staged domain adaptation: Phase 2 unfreezes late generator blocks and the hyperprior, activates weighted-MSE and insulation losses, and begins learning which regions to preserve.
- Staged domain adaptation: Phase 3 optionally unfreezes the full network at a much lower learning rate for final bitrate refinement.Reduced learning rates and distillation toward the pretrained checkpoint further guard against destabilization.
- Feature detection: The heuristic and statistical detectors are retained because they measure different criteria rather than one correcting the other.A threshold grid search achieved only 0.29–0.36 combined agreement, with loop agreement never exceeding 0.04.
3.6 Fixed-Size Tiling
HiFiC-G uses overlapping fixed-size tiles to make Hi-C compression feasible on consumer GPUs, but the compartment-context modification remains unresolved after limited fine-tuning.
- Fixed-size tiling: HiFiC-G processes contact matrices as overlapping 256×256-bin tiles with 50% stride to keep memory use manageable.Full chromosome training is impractical because dense N × N matrices and stored activations scale memory demands substantially.
- Fixed-size tiling: The original tiling scheme encodes each tile as three identical copies of the same local data because the pretrained checkpoint expects RGB input.The redundant channels contain no information absent from channel 1.
- Fixed-size tiling: Broadcast row and column compartment-identity channels can be added without architectural changes and fit the Phase 1 adaptation stage.The channels provide chromosome-level context that local windows cannot contain, simplifying the conditioning task.
- Fixed-size tiling: The new channels remain far below the original scheme’s baseline quality even after limited fine-tuning.An untrained checkpoint reconstructs much worse, while limited fine-tuning improves it only partly.
3.8 Additional Auxiliary Loss: Compartment Pattern
HiFiC-G adds a compartment-pattern loss that directly compares long-range checkerboard structure without differentiable eigendecomposition, alongside the project’s other Hi-C-specific modifications.
- Additional auxiliary loss: The compartment-pattern loss targets the long-range A/B checkerboard pattern not covered by the insulation-score loss.
- Additional auxiliary loss: It compares far-off-diagonal row-correlation matrices from the original and reconstructed tiles using MSE.This avoids differentiable eigendecomposition, whose gradients may become unstable when eigenvalues are close.
- Additional auxiliary loss: The project combines this loss with a Hi-C data pipeline, spatially weighted distortion, insulation-score loss, and staged fine-tuning.
- Evaluation resources: Per-chromosome preservation metrics for both cell lines and resolutions are available in the project repository.Training code and checkpoints are planned after the compartment-context experiments are finalized.
4 Experiments
The evaluation covers two human cell lines at two resolutions, comparing pretrained, baseline, and fine-tuned models with image-quality and structure-preservation metrics. Statistical-detector results show strong stripe preservation, moderate TAD preservation, and poor loop and compartment preservation, while heuristic-detector results are not directly comparable and cross-cell-line TAD differences remain unresolved.
- Evaluation Setup: The evaluation spans GM12878 and K562 at 25 kb and 100 kb across chromosomes 1–22, X, and Y.Models include pretrained HiFiC variants, an internal no-GAN baseline, and successive fine-tuned HiFiC-G checkpoints.
- Evaluation Setup: Metrics include compression ratio, PSNR, SSIM, loop/TAD/compartment/stripe preservation, and loop/TAD noise reduction.Table 1 uses the medium model configuration and statistical detector.
- Statistical-Detector Results: 79–86% stripe preservation contrasts with 32–62% TAD, 14–26% loop, and 4–11% A/B compartment preservation across both cell lines and resolutions.The ordering follows genomic scale: local near-diagonal structures fit within tiles, whereas compartments depend on correlations tens of megabases away.
- Statistical-Detector Results: Figure 1 relates compression ratio to PSNR, SSIM, loop preservation, and TAD preservation for K562 at both resolutions.The figure uses the statistical detector across all evaluated chromosomes.
- Cross-Cell-Line Comparison: GM12878 has consistently higher SSIM at 25 kb, whereas K562 has consistently higher SSIM at 100 kb.The opposite resolution effects reflect dataset-dependent interactions between noise or signal characteristics and resolution, rather than a model artifact.
- Heuristic-Detector Results: Table 2 is an earlier chr22 comparison using a heuristic detector and pre-correction source data, so its values are not directly comparable row-for-row with Table 1.For example, compartment preservation is reported as 64.9–71.4% versus 4.1–11.0%, with detector sensitivity and source-data differences contributing to the gap.
- Cross-Cell-Line Comparison: K562 TAD preservation is 57.3–62.4%, compared with 32.2–46.8% for GM12878 at both resolutions.The datasets are now confirmed human, but the biological and detector-sensitivity explanations for the residual gap remain unresolved.
- Diagnostic Visualization: Diagnostic panels show original matrices, reconstructions, weight maps, and detected-structure overlays, but they are illustrative rather than independent evidence.Visual plausibility can coexist with failure on rigorous structural-preservation tests.
5 Discussion
The discussion identifies fixed-size tiling as the main constraint on long-range compartment preservation and emphasizes several evaluation limitations that bound the conclusions. These include unresolved detector disagreement, incomplete channel experiments, limited baselines and statistical treatment, and the absence of individual loss-term ablations.
- Compartment preservation: A/B compartment structure is preserved substantially worse than loops, TAD boundaries, or stripes because fixed-size local windows cannot consistently represent long-range compartment identity.The authors distinguish this architectural mismatch from a simple pixel-level scale effect.
- Compartment preservation: Whole, untiled chromosome evaluation is needed to distinguish genuine compartment destruction from survival that stricter detectors cannot certify.This evaluation is outside the project’s available compute and remains the central open scientific question.
- Limitations: Compartment-context channels currently produce well-formed tensors but reconstruction remains far below the original three-duplicate-channel baseline after limited fine-tuning.The reported PSNR is 9–16 dB versus a 35–38 dB baseline.
- Limitations: Structure detection relies on two internally implemented, non-standard detectors that have not been cross-validated against reference callers.The implementations follow published definitions but could not use an established package such as cooltools.
- Limitations: The study lacks generic lossless, generic image-codec, and Hi-C-specific compression baselines, limiting claims about absolute compression ratios.The comparison currently covers unmodified pretrained HiFiC and an internal no-GAN ablation.
- Limitations: Evaluation covers two cell lines without variability or paired significance tests, uses single operating points, and lacks isolated ablations of the individual loss terms.A four-way vanilla, weighted-MSE, insulation-loss, and combined ablation remains unfinished.
6 Conclusion
HiFiC-G adapts pretrained HiFiC to Hi-C using biologically informed losses and staged fine-tuning. It preserves local genomic structures better than conventional image metrics alone indicate, but fixed-size tiling limits long-range compartment preservation.
- Method: HiFiC-G replaces HiFiC’s distortion term with a biologically weighted alternative and adds auxiliary losses for TAD boundary sharpness and long-range compartment patterns.A staged fine-tuning procedure adapts a pretrained natural-image checkpoint to Hi-C contact matrices.
- Results: Against unmodified HiFiC, HiFiC-G preserves stripe and TAD structure at levels that track genomic scale.The evaluation covers two cell lines and two resolutions.
- Results: A/B compartment structure remains poorly preserved under a strict detector, attributed to fixed-size tiling rather than the loss design.Compartment identity is defined at a genomic distance the tiling scheme cannot represent.
- Implications: Metrics tuned for human perception do not reliably track biological fidelity, especially for structures defined at long genomic range.The conclusion motivates context-aware compression models as a future direction.
Broader Impact
Generative compression can produce plausible-looking Hi-C structure that was absent from the original matrix, creating a risk of misleading downstream biological interpretation.
- Risks: Hallucinated loops or smoothed-over TAD boundaries could mislead biological interpretation if reconstructions replace or are mistaken for original matrices.The authors state that released models or tools should be clearly labeled as lossy compression.