README.md

March 29, 2026 ยท View on GitHub

UniX: Unifying Autoregression and Diffusion for
Chest X-Ray Understanding and Generation

๐Ÿ”ฅ Better Unified Performance with 25% Parameters: +46.1% Understanding & +24.2% Generation Quality!

Ruiheng Zhang1,*, ย  Jingfeng Yao2,*, ย  Huangxuan Zhao1,*,โœ‰๏ธ, ย  Hao Yan1, ย  Xiao He1, ย  Lei Chen2,
Zhou Wei1, ย  Yong Luo1, ย  Zengmao Wang1, ย  Lefei Zhang1, ย  Dacheng Tao3, ย  Bo Du1,โœ‰๏ธ

1Wuhan University โ€ƒ 2Huazhong University of Science and Technology โ€ƒ 3Nanyang Technological University

*equal contribution โ€ƒ โœ‰๏ธ corresponding author

arXivย Hugging Faceย ModelScope

๐Ÿ“ฐ News

  • [2026.01.19] ๐ŸŽ‰ Our paper UniX is released on arXiv! We also release the weights on Hugging Face.
  • [2026.03.30] ๐Ÿš€ We release the training code.

๐Ÿš€ Release Plan

  • Release paper
  • Release UniX model weights
  • Release inference code (CLI & Gradio WebUI)
  • Release evaluation code
  • Release training code

โšก Quick Start

  1. Install Environment

    git clone https://github.com/ZrH42/UniX.git
    cd UniX
    conda create -n unix python=3.10 -y
    conda activate unix
    bash install.sh
    
  2. Download Weights at HuggingFace or ModelScope

    weights/
       โ””โ”€โ”€ UniX/
    
  3. Launch Gradio Demo

    python demo_gradio.py
    

๐Ÿ“„ Introduction

architecture
Unified medical modeling has emerged as a promising direction for generalist clinical AI, offering the potential to integrate reasoning and synthesis. However, existing unified medical foundation models largely lag behind specialized single-task models in performance, primarily due to the inherent conflict between semantic abstraction and pixel-level reconstruction objectives.

UniX bridges this gap by answering a fundamental question: Can we decouple these conflicting goals while maintaining deep synergy? We propose a dual-branch architecture that "unifies" autoregressive understanding and diffusion generation through structural decoupling and dynamic coordination. Unlike prior parameter-sharing approaches restricted by feature interference, UniX introduces a novel Cross-Modal Self-Attention mechanism. This allows for precise semantic guidance during generation without degrading comprehension. With this integrated design, utilizing only 25% of the parameters required by previous methods like LLM-CXR, UniX achieves state-of-the-art performance among unified models, delivering a 46.1% improvement in understanding and a 24.2% gain in generation quality.

โœจ Highlights

  • Decoupled Dual-Branch Architecture: Unifies autoregressive understanding and diffusion-based generation to fundamentally resolve intrinsic task conflicts and feature interference.

  • Superior Efficiency & Quality: Achieves unified performance with only 25% parameters while boosting understanding by 46.1% and generation quality by 24.2%.

  • Cross-Modal Synergy: Introduces a novel self-attention mechanism that enables dynamic semantic guidance for high-fidelity, continuous medical image synthesis.

    und_metrcis gen_metrcis

๐Ÿš€ Get Started

DocumentDescription
InstallationEnvironment setup and model preparation
Inference & EvaluationQuick inference with pre-trained weights and evaluate
TrainingTraining scripts for understanding and generation tasks

โค๏ธ Acknowledgements

This repo is mainly built on BAGEL, Janus-Pro, REPA, latent-diffusion, CheXbert, CheXGenBench. We thank the authors for their open-source contributions.

๐Ÿ“ Citation

If you find our work useful, please cite our paper:

@article{zhang2026unix,
  title={UniX: Unifying Autoregression and Diffusion for Chest X-Ray Understanding and Generation},
  author={Zhang, Ruiheng and Yao, Jingfeng and Zhao, Huangxuan and Yan, Hao and He, Xiao and Chen, Lei and Wei, Zhou and Luo, Yong and Wang, Zengmao and Zhang, Lefei and others},
  journal={arXiv preprint arXiv:2601.11522},
  year={2026}
}