Unifying VLM-Guided Flow Matching and Spectral Anomaly Detection for Interpretable Veterinary Diagnosis
Organizations: School of Mathematics, Shandong University · Shenzhen Loop Area Institute · Yeshiva University · Qilu University of Technology ·
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-Language Model (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).
Figures & tables
| Category | Year | Model | Test Set | |
| mDice | mIoU | |||
| Unet-based | 2015 | Unet [ 34 ] | 0.8774 | 0.7878 |
| 2018 | Unet++ [ 22 ] | 0.8712 | 0.7788 | |
| 2025 | PolypFlow [ 41 ] | 0.8869 | 0.8019 | |
| 2020 | Net [ 16 ] | 0.8834 | 0.7965 | |
| 2022 | Swin-UNet [ 6 ] | 0.8462 | 0.7424 | |
| Model | Test Set | |||
|---|---|---|---|---|
| Acc. | Prec. | Rec. | F1 | |
| GoogleNet [ 37 ] | 0.8270 | 0.6787 | 0.5587 | 0.6129 |
| VGG16 [ 35 ] | 0.2451 | 0.2451 | 1.0000 | 0.3938 |
| ResNet50 [ 12 ] | 0.5908 | 0.3494 | 0.7769 | 0.4821 |
| DenseNet201 [ 23 ] | 0.8379 | 0.7263 | 0.5438 | 0.6219 |
| Inceptionv3 [ 38 ] | 0.8485 | 0.7680 | 0.5471 | 0.6390 |
| Setting | Model Components | Seg. Performance | Class. Performance | ||||
| Text Guidance | Flow Matching | RMT Input (Purification) | mDice | mIoU | AUC | F1-Score | |
| Experiment 1: Ablation on Segmentation Components | |||||||
| (a) | – | 0.8830 | 0.7949 | – | – | ||
| (b) | ✓ | – | 0.8736 | 0.7051 | – | – | |
| (c) | ✓ | ✓ | – | 0.8953 | 0.8114 | – | – |
| Experiment 2: Ablation on Classification Synergy | |||||||
Medical Image Anomaly Detection
Medical image anomaly detection finds and localizes unusual anatomy or pathology in scans, often when labeled disease examples are scarce.
See all 87 papers