MAGIC-Flow: Multiscale Adaptive Conditional Flows for Generation and Interpretable Classification
Luca Caldera, Giacomo Bottacini, Lara Cavinato
TL;DR
MAGIC-Flow tackles the need for trustworthy medical-image generation and classification by unifying these tasks in a conditional multiscale normalizing flow with an invertible backbone. It derives exact likelihoods via a conditional change-of-variables formulation and leverages a hierarchical architecture with flow steps, squeeze/split operations, and mask-based transformations to enable both high-fidelity conditional synthesis and likelihood-based classification. The model introduces task-specific affine couplings (generation vs classification) and likelihood attribution maps for faithful interpretability, achieving superior fidelity, diversity, and scanner-robust performance on MRI and PET data while providing interpretable explanations. This framework supports privacy-preserving augmentation and robust generalization in data-limited, acquisition-variant clinical settings, with planned extensions to 3D processing, uncertainty quantification, pathology-conditioned generation, and cross-institutional deployment.
Abstract
Generative modeling has emerged as a powerful paradigm for representation learning, but its direct applicability to challenging fields like medical imaging remains limited: mere generation, without task alignment, fails to provide a robust foundation for clinical use. We propose MAGIC-Flow, a conditional multiscale normalizing flow architecture that performs generation and classification within a single modular framework. The model is built as a hierarchy of invertible and differentiable bijections, where the Jacobian determinant factorizes across sub-transformations. We show how this ensures exact likelihood computation and stable optimization, while invertibility enables explicit visualization of sample likelihoods, providing an interpretable lens into the model's reasoning. By conditioning on class labels, MAGIC-Flow supports controllable sample synthesis and principled class-probability estimation, effectively aiding both generative and discriminative objectives. We evaluate MAGIC-Flow against top baselines using metrics for similarity, fidelity, and diversity. Across multiple datasets, it addresses generation and classification under scanner noise, and modality-specific synthesis and identification. Results show MAGIC-Flow creates realistic, diverse samples and improves classification. MAGIC-Flow is an effective strategy for generation and classification in data-limited domains, with direct benefits for privacy-preserving augmentation, robust generalization, and trustworthy medical AI.
