ZrH42/UniX

31

stars

5

commits

Python

primary language

Mar 29, 2026

updated

README

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 University2Huazhong University of Science and Technology3Nanyang 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}
}

Contributors

ZrH42

5 commits

ZrH42/UniX

31

stars

5

commits

Python

primary language

Mar 29, 2026

updated

README

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 University2Huazhong University of Science and Technology3Nanyang 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}
}

Contributors

ZrH42

5 commits

Languages

Python

98.9%

Shell

1.1%