Papers
Topics
Authors
Recent
Search
2000 character limit reached

Unifying VLM-Guided Flow Matching and Spectral Anomaly Detection for Interpretable Veterinary Diagnosis

Published 7 Apr 2026 in cs.CV and cs.AI | (2604.05482v1)

Abstract: Automatic diagnosis of canine pneumothorax is challenged by data scarcity and the need for trustworthy models. To address this, we first introduce a public, pixel-level annotated dataset to facilitate research. We then propose a novel diagnostic paradigm that reframes the task as a synergistic process of signal localization and spectral detection. For localization, our method employs a Vision-LLM (VLM) to guide an iterative Flow Matching process, which progressively refines segmentation masks to achieve superior boundary accuracy. For detection, the segmented mask is used to isolate features from the suspected lesion. We then apply Random Matrix Theory (RMT), a departure from traditional classifiers, to analyze these features. This approach models healthy tissue as predictable random noise and identifies pneumothorax by detecting statistically significant outlier eigenvalues that represent a non-random pathological signal. The high-fidelity localization from Flow Matching is crucial for purifying the signal, thus maximizing the sensitivity of our RMT detector. This synergy of generative segmentation and first-principles statistical analysis yields a highly accurate and interpretable diagnostic system (source code is available at: https://github.com/Pu-Wang-alt/Canine-pneumothorax).

Summary

  • The paper presents a two-stage framework combining VLM-guided flow matching for refined lesion segmentation with RMT-based spectral anomaly detection.
  • The paper achieves superior diagnostic accuracy with mDice of 0.8953, mIoU of 0.8114, and overall classification accuracy of 0.9032.
  • The paper enhances interpretability by decoupling feature extraction from breed-specific patterns, promoting reproducible and robust veterinary diagnosis.

Unifying VLM-Guided Flow Matching and Spectral Anomaly Detection for Interpretable Veterinary Diagnosis

Introduction

The diagnosis of canine pneumothorax presents significant challenges due to subtle radiological features, inter-breed anatomical heterogeneity, and data scarcity in annotated veterinary imaging. The work by Wang et al. ("Unifying VLM-Guided Flow Matching and Spectral Anomaly Detection for Interpretable Veterinary Diagnosis" (2604.05482)) addresses these challenges by proposing a synergistic diagnostic framework that integrates multimodal semantic guidance for lesion segmentation with principled statistical anomaly detection using Random Matrix Theory (RMT).

The authors construct and release the first pixel-annotated veterinary radiology dataset for canine pneumothorax, establishing a benchmark for future research. A two-stage methodology is advanced: (i) VLM-guided Flow Matching for refined, text-driven segmentation, and (ii) RMT-based spectral anomaly scoring for interpretable diagnostic classification. The system aims to deliver high diagnostic accuracy, generalizability, and interpretable outputs—attributes that are demanded for practical clinical deployment.

Motivation and Diagnostic Landscape

The main limitation of existing AI approaches in veterinary radiology is twofold: the lack of large, high-quality labeled datasets, and the opacity of "black box" predictors, which is particularly problematic for trust in clinical decision support. The challenge is further compounded by the morphological diversity among dog breeds, impeding generalization of models that memorize anatomical priors. Figure 1

Figure 1: Comparison of diagnostic approaches for canine pneumothorax, highlighting the challenge of subtle indicators, black-box model limitations, and the explicit interpretability provided by the proposed framework.

Conventional supervised deep learning approaches, predominantly U-Net and its variants, are sensitive to domain shift and label scarcity, with diminished reliability for rare presentations. By reframing diagnostic image analysis as the localization of statistical signal anomalies, the proposed approach disentangles pathological feature detection from anatomical memorization.

Methodological Contributions

Data Foundation and Pipeline Overview

The dataset is curated from publicly available canine thoracic radiographs with expert pixel-level consensus segmentations. The authors adopt a stratified train/val/test partition accounting for class imbalance, thus ensuring robust and reproducible leaderboard-style benchmarking. Figure 2

Figure 2: Overview of the synergistic framework, combining VLM-guided segmentation with RMT-driven diagnostic classification.

VLM-Guided Flow Matching Segmentation

Initial mask proposals are generated via a U-Net architecture incorporating a ViT backbone, leveraging global context. Crucially, textual prompts are introduced via VLM to inform semantic alignment. Mask refinement is formally modeled as an ODE-driven flow along a learned vector field, where VLM-driven cross-attention mechanisms iteratively distill localization errors. Conditional flow matching (CFM) loss ensures that refinement is statistically aligned with manual delineations.

This dual-modality approach decouples the extracted features from breed-specific anatomical artifact, permitting transfer and generalization.

RMT-Based Spectral Anomaly Detection

Upon segmentation, the region of interest (ROI) is subjected to feature extraction and dimensional standardization. Healthy tissue patch features are expected to conform to the Marchenko-Pastur law, i.e., their empirical spectral distribution should be indistinguishable from random noise. Pneumothorax presence induces "spikes"—large, outlier eigenvalues—in the sample covariance spectrum. The Spectral Anomaly Score (SAS) aggregates the deviation magnitude of these eigenvalues beyond the MP upper bound. This scalar serves as input to a logistic classifier trained with Focal Loss to mitigate class imbalance.

This first-principles approach reifies pathological detection as a hypothesis test, ensuring explicitly interpretable outputs.

Quantitative and Qualitative Results

The authors present strong numerical gains in both segmentation and diagnostic accuracy when compared to a comprehensive set of baselines including classical CNNs (U-Net, DenseNet, ResNet), vision transformers, as well as recent Mamba-based and Segment Anything Model (SAM) architectures.

  • Segmentation: The framework delivers an mDice of 0.8953 and mIoU of 0.8114, outperforming both U-Net-based and transformer-based models (e.g., PolypFlow, DeepLabv3+, Swin-UMamba) by a non-trivial margin.
  • Classification: The system yields an accuracy of 0.9032 with an F1-score of 0.7962, with ROC AUC at 0.939 and Average Precision of 0.885, notably higher than alternative models. Figure 3

    Figure 3: (a) Receiver Operating Characteristic curves and (b) Precision-Recall curves, showing that the proposed model leads in both AUC and Average Precision metrics across all operating thresholds.

    Figure 4

    Figure 4: Comparative confusion matrices for all evaluated methods demonstrate the proposed model's superior balance in identifying positives/negatives with low error rates.

Qualitatively, the VLM-flow matching module produces masks with substantially improved boundary fidelity when compared to Unet, SAM, and transformer-based methods, critical for guaranteeing precise signal purification ahead of statistical testing. Figure 5

Figure 5: Visual comparison of segmentation outcomes; the proposed framework achieves superior contour accuracy over all U-net family baselines.

Figure 6

Figure 6: Qualitative segmentation comparisons with four alternative methods illustrate reduced noise and fragmentation in the proposed model's outputs.

Figure 7

Figure 7: Side-by-side segmentation performance for transformer-based and Mamba-based architectures against the VLM-guided approach.

Ablation studies confirm that VLM text guidance alone degrades performance due to noisy semantic projections, but its synergy with the flow matching module is pivotal. Additionally, restricting the classifier's input to the ROI (rather than the full image) is essential for maximizing diagnostic F1, validating the pipeline's architectural decisions.

Interpretability and Theoretical Significance

A major contribution is the shift from opaque end-to-end predictors toward modular, interpretable pipelines where each transformation aligns with a clinical rationale. The flow matching mechanism, guided by VLM, enhances transparency in mask refinement, while the RMT-based hypothesis test supports statistical validation of findings—a critical requirement in medical domains.

The systematic adoption of spectral anomaly detection opens diagnostic AI to principled hypothesis testing, explicitly reporting evidence of pathological deviation, rather than memorized symptom complexes or brittle discriminative boundaries.

Implications and Future Directions

Practically, the methodology addresses clinical requirements of trust, reproducibility, and expert oversight. Release of a rigorously annotated open dataset catalyzes future benchmarking and reproducibility in veterinary imaging. The work's framework is also directly extensible to other domains characterized by data paucity, label noise, or where statistical interpretability is paramount.

Theoretically, the integration of vision-language semantics with statistical signal models bridges generative and discriminative paradigms, advancing interpretable AI. Anticipated future directions include the extension of RMT-driven anomaly detection to high-order spectral and geometric descriptors, adversarial robustness assessment, and real-time interactive diagnostic systems leveraging in-context language guidance for continual learning and expert feedback.

Conclusion

This work establishes a robust, interpretable paradigm for automatic canine pneumothorax diagnosis, unifying VLM-guided segmentation with RMT-based anomaly detection. Empirical results demonstrate a consistent and significant performance advantage over baselines, and the approach meets both practical and theoretical demands for clinically trustworthy AI in label-scarce veterinary domains. The public release of annotated data and modular code further ensures extensibility and adoption across broader medical imaging contexts.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.