MoECodec: Image Compression for joint human and machine perception via Mixture-of-Experts

Jiancheng Zhao, Xiang Ji, Yifan Zhan, Zunian Wan, Yinqiang ZhengarXiv 2026

TL;DR

MoECodec is a novel token-aware image compression framework that uses a Mixture-of-Experts (MoE) architecture to dynamically allocate computation based on image content and specific task objectives. By replacing standard transformer feed-forward networks with lightweight Group Shuffle MLPs and employing a spatially regularized Expert-Choice routing strategy, it achieves superior rate-distortion performance for both human reconstruction and downstream machine vision tasks within a single unified model.

What Problem Does This Paper Address?

Traditional Learned Image Compression (LIC) frameworks apply uniform, static computation patterns across an entire image. However, different image regions exhibit vastly different semantic importance and complexity. Furthermore, human perception and machine vision models prioritize different features; human-centric compression focuses on fine-grained pixel details, whereas machine vision tasks (like object detection or segmentation) rely heavily on high-level semantic structures.

Existing multi-task image compression methods typically rely on task-specific encoder-decoder pairs or external adapters, which incur heavy parameter overhead and deployment complexity. Integrating a Mixture-of-Experts (MoE) architecture seems like a natural fix to achieve dynamic computation, but doing so naively introduces two major challenges in LIC:

  1. Spatially Fragmented Routing: Compression transformers often use point-wise tokenization (e.g., $1 \times 1$ patches). Making independent token-wise routing decisions without spatial context results in noisy, "salt-and-pepper" artifacts in the routing maps.
  2. Parameter Explosion: Feed-Forward Networks (FFNs) account for the majority of parameters in transformer-based LIC models. Replacing every FFN with multiple independent experts causes an unsustainable explosion in model size.

Methods

MoECodec addresses these challenges by restructuring the standard transformer blocks within an autoencoder-based compression framework.

Overall architecture of MoECodec, featuring the MoE Layer and the Group Shuffle MLP (GShMLP) expert design.

The core technical contributions include:

  • Expert-Choice (EC) Routing: Instead of tokens independently choosing their preferred experts (which often causes load imbalance), MoECodec reverses the paradigm: each expert actively selects its top-$k$ preferred tokens from the entire image sequence. This guarantees balanced expert utilization and leverages global context.
  • Spatial Total Variation (TV) Regularization: To eliminate the "salt-and-pepper" routing artifacts, the authors introduce an anisotropic TV regularization loss during training. This explicitly penalizes high-frequency variations in the token-expert affinity maps, encouraging smooth, spatially coherent expert assignments.
  • Group Shuffle MLP (GShMLP): To mitigate parameter overhead, the standard dense FFN is replaced with a lightweight grouped architecture. The projection matrices are constrained to a block-diagonal form (channel grouping), and a parameter-free channel shuffle operation is inserted between the layers to restore cross-group channel interactions.

Datasets

The framework was trained and evaluated across several standard benchmarks:

  • Image Reconstruction: Trained from scratch on Flickr2W. Evaluated on the classic Kodak and CLIC datasets using PSNR and MS-SSIM metrics.
  • Machine Vision Tasks: Evaluated on ImageNet-1K validation (for top-1 classification accuracy via a pre-trained ResNet50) and COCO 2017 validation (for object detection and instance segmentation via Faster R-CNN and Mask R-CNN).

Key Insights and Ideas

  • Reversing the Routing Perspective: Switching from token-choice to expert-choice routing inherently solves the load-balancing problem common in MoE architectures without requiring complex auxiliary balancing losses.
  • Exploiting Spatial Continuity: Because images possess strong spatial correlations, routing functions shouldn't treat tokens as isolated points. Incorporating a spatial TV loss acts as a powerful inductive bias that aligns expert routing with actual image topology.
  • Task-Adaptive Compute Allocation: Visualizations reveal that MoECodec naturally alters its computation based on the objective. When optimizing for human viewing (MSE), it allocates compute to high-frequency textures (like grass or water). When optimizing for machine vision, it automatically shifts compute toward object contours and semantically relevant foreground targets.
Visualization of expert specialization maps, demonstrating how EC routing and Spatial TV regularization yield cleaner, more coherent token selection compared to Token-Choice (TC) routing.

Key Results

MoECodec was evaluated against three prominent transformer-based LIC baselines: TIC, TinyLIC, and TCM.

  • Reconstruction Gains: Applying MoECodec yielded significant BD-Rate improvements (where lower is better) across the board: 11.54% for TIC, 8.12% for TinyLIC, and 6.42% for TCM, all while slightly reducing the total parameter count.
  • Downstream Task Efficiency: When using TIC as a base codec for machine tasks, MoECodec outperformed full fine-tuning baselines, improving BD-Rate by 7.74% for classification, 8.98% for object detection, and 9.72% for instance segmentation.
  • Operational Efficiency: Thanks to the GShMLP design, the number of activated parameters per forward pass dropped significantly (e.g., from 7.51M down to 6.25M for the TIC backbone). This translated to practical hardware benefits, outperforming the original dense TIC baseline with an 8.4% reduction in end-to-end latency on an NVIDIA RTX 4090.
Radar chart showing the multi-faceted efficiency gains (BD-rate, parameters, latency, GMACs) of MoECodec across different backbones.

Limitations and Future Work

Not explicitly discussed in the provided text.

Summary updated

BibTeX
@misc{zhao2026moecodec,
  author = {Jiancheng Zhao and Xiang Ji and Yifan Zhan and Zunian Wan and Yinqiang Zheng},
  title = {{MoECodec: Image Compression for joint human and machine perception via Mixture-of-Experts}},
  year = {2026},
  eprint = {2606.21033},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.21033},
}
Figure