ART-ASyn: Anatomy-aware Realistic Texture-based Anomaly Synthesis Framework for Chest X-Rays

Qinyi Cao, Jianan Fan, Weidong Cai

TL;DR

ART-ASyn is a novel self-supervised framework for chest X-ray anomaly detection that synthesizes highly realistic, anatomically consistent lung opacity lesions. By combining a rule-based progressive lung segmentation method (PBTSeg) with a dynamic texture brush that respects underlying rib structures, it enables explicit pixel-level segmentation supervision. This approach yields state-of-the-art performance in both image-level anomaly detection and zero-shot pixel-level anomaly segmentation on unseen datasets.

What Problem Does This Paper Address?

Unsupervised anomaly detection (UAD) is highly desirable in medical imaging because precise, pixel-level pathological annotations are incredibly expensive and time-consuming to obtain. Traditional UAD methods typically try to learn the distribution of "normal" anatomy using a corrupt-and-reconstruct paradigm (e.g., via Autoencoders or Diffusion models). However, these models often suffer from the "identical shortcut" problem, where they accidentally learn to replicate or denoise the anomalous regions instead of fixing them.

To bypass this, synthesis-based methods artificially inject anomalies into normal images so the model has explicit, known spatial targets to learn from. The catch? Existing synthesis techniques (like CutPaste or NSA) generate patches that look visually jarring or anatomically impossible—such as pasting a lesion outside the lung or completely obliterating the visibility of the ribs underneath. Models trained on these unrealistic images overfit to superficial cues and fail to generalize to real clinical cases.

Methods

The authors introduce ART-ASyn (Anatomy-aware Realistic Texture-based Anomaly Synthesis), which operates in two core stages:

  1. Progressive Binary Thresholding Segmentation (PBTSeg): To ensure anomalies are only placed inside the lungs, the authors developed an unsupervised, rule-based segmentation method. Instead of relying on a single global intensity threshold (which fails across different patients and scanners), PBTSeg iteratively tests a series of ascending thresholds. It filters connected components using geometric rules (like roundness, aspect ratio, and area constraints) to progressively grow and refine highly accurate lung masks without requiring any deep learning supervision.
  2. Anatomy-aware Texture Synthesis: Once the lung region is mapped, random anchor points are selected. A dynamic brush tool paints base textures using randomized size, angle, and opacity jitters. Crucially, the framework applies three realistic transformations to these textures:
  3. Crystallization: Introduces sharp, irregular margins typical of malignant pleural effusions.
  4. Blurring: Emulates the diffuse, dense tissue appearance of consolidations.
  5. Intensity Scaling: Scales the anomaly's brightness based on the patient's underlying rib intensity map. This ensures that synthetic lesions do not unnaturally block out high-intensity rib shadows, preserving radiographic realism.
Figure 1. Overview of the ART-ASyn synthesis pipeline for generating realistic synthetic lung opacity related anomalies in CXR images. Random points within the lung region segmented by PBTSeg are painted using a dynamic brush to form an initial anomaly. A series of transformations are then combined and applied to this anomaly, which is overlaid onto the original CXR image to create a synthetic abnormal image.

Training and Loss Functions

Using the generated triplets—the normal image, the synthetic abnormal image, and the precise synthetic anomaly mask—the framework trains a U-Net architecture. It optimizes a combined loss function consisting of global reconstruction loss, local reconstruction loss (focusing strictly on the anomalous zone), a feature-alignment loss (forcing the encoder to create anomaly-invariant representations), and a Dice loss to directly supervise pixel-level anomaly segmentation.

Datasets

The framework was validated across three distinct chest X-ray (CXR) datasets:

  • CheXpert: 12,234 healthy frontal CXRs were used for training; evaluation was performed on the expert-verified test set (500 images) for image-level classification.
  • ZhangLab: 1,349 healthy CXRs were used for training; evaluated on the standard test set for image-level classification.
  • QaTa-ZeroShot: A custom zero-shot benchmark built from the QaTa-COV19-v2 dataset (9,250 samples containing pixel-level lung abnormality annotations). No images from this dataset were seen during training, serving as a strict test for zero-shot pixel-level segmentation generalizability.

Key Insights and Ideas

  • Radiographic Realism Requires Structure Awareness: Simply blending patches into an image isn't enough for X-rays. Because X-rays are projection images, a real lesion overlays bones rather than replacing them. By scaling the synthetic textures according to the rib intensity map, ART-ASyn forces the model to learn subtle density variations rather than obvious edge discontinuities.
  • Unsupervised Multi-Thresholding Beats Single Thresholds: Traditional rule-based lung segmentation often falls apart due to contrast variations. PBTSeg proves that an iterative, rule-based region-growing approach across multiple thresholds can match the reliability of supervised masks for synthesis tasks without needing any manual labels.
Figure 2. (a) PBTSeg process illustration of lung mask segmentation using multi-thresholding, where the second row shows candidate regions after rule-based selection for each threshold, and the last row illustrates the iterative process of updating the segmentation regions; (b) Comparison of lung segmentation results using our PBTSeg method against the threshold-based approach adopted in AnatPaste for CXR images.
  • Synthetic Masks Unlock Zero-Shot Segmentation: Providing explicit pixel-level Dice loss during training completely changes how the network behaves. Instead of just learning a global classification signal, the model gains fine-grained localization capabilities that generalize remarkably well to entirely unseen datasets and pathologies (like COVID-19 opacities).

Key Results

ART-ASyn outperformed both reconstruction-based and synthesis-based state-of-the-art baselines across almost all metrics:

Image-Level Detection

  • CheXpert: Achieved an Average Precision (AP) of 0.8639, significantly outperforming the next best method, UniAS (0.7926).
  • ZhangLab: Achieved an AP of 0.9621 and an AUC of 0.9350, beating the closest competitor, AnatPaste (AP: 0.8848, AUC: 0.9103).

Pixel-Level Segmentation (Zero-Shot)

  • On the QaTa-ZeroShot benchmark, ART-ASyn achieved a Dice score of 0.3275.
  • For context, the second-best baseline (NSA) scored 0.2371, while other highly regarded image-level anomaly detection methods like UniAS and CutPaste completely failed to localize the lesions, returning Dice scores near 0.00.

Limitations and Future Work

The authors note two primary limitations:

  1. Computational Overhead of PBTSeg: Because PBTSeg is an iterative, rule-based algorithm, it is roughly 10 times slower than simple single-threshold methods. However, this is a one-time preprocessing cost during data preparation.
  2. Pathology Scope: The current synthesis pipeline is specifically tailored to lung opacity-related abnormalities (like pneumonia or effusions). Extending the framework to synthesize and detect a broader range of chest pathologies (such as pneumothorax or cardiomegaly) remains an open direction for future research.

Summary updated

Abstract

Unsupervised anomaly detection aims to identify anomalies without pixel-level annotations. Synthetic anomaly-based methods exhibit a unique capacity to introduce controllable irregularities with known masks, enabling explicit supervision during training. However, existing methods often produce synthetic anomalies that are visually distinct from real pathological patterns and ignore anatomical structure. This paper presents a novel Anatomy-aware Realistic Texture-based Anomaly Synthesis framework (ART-ASyn) for chest X-rays that generates realistic and anatomically consistent lung opacity related anomalies using texture-based augmentation guided by our proposed Progressive Binary Thresholding Segmentation method (PBTSeg) for lung segmentation. The generated paired samples of synthetic anomalies and their corresponding precise pixel-level anomaly mask for each normal sample enable explicit segmentation supervision. In contrast to prior work limited to one-class classification, ART-ASyn is further evaluated for zero-shot anomaly segmentation, demonstrating generalizability on an unseen dataset without target-domain annotations. Code availability is available at https://github.com/angelacao-hub/ART-ASyn.
BibTeX
@inproceedings{cao2026art,
  author = {Qinyi Cao and Jianan Fan and Weidong Cai},
  title = {{ART-ASyn: Anatomy-aware Realistic Texture-based Anomaly Synthesis Framework for Chest X-Rays}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2026},
}
Figure