Abstract
Medical anomaly detection is a critical task in healthcare AI, characterized by the challenge of identifying rare pathologies within datasets dominated by healthy samples. Traditional methods typically utilize Euclidean geometry to represent image features; however, this "flat" geometry often fails to capture the complex, hierarchical nature of anatomical structures. This paper explores a novel framework that shifts feature representation into hyperbolic space using the Lorentz model. By leveraging the inherent capacity of hyperbolic geometry to represent tree-like structures, the proposed approach achieves state-of-the-art performance on the Benchmarks for Medical Anomaly Detection (BMAD) suite, demonstrating particular efficacy in few-shot learning scenarios where training data is extremely limited.
Introduction
In medical imaging, anomalies such as tumors, lesions, or structural deformities are often rare occurrences compared to the vast amount of data representing healthy patients. This creates a "needle in a haystack" problem for machine learning models. Most contemporary anomaly detection methods extract features from pre-trained neural networks and analyze them within Euclidean space.
While Euclidean geometry is the standard for general computer vision, it is often ill-suited for medical data. Anatomical structures—such as the branching of the respiratory system from the trachea down to the alveoli—are inherently hierarchical. Euclidean space lacks the mathematical "room" to accommodate the exponential growth of these tree-like structures without significant distortion. This mismatch leads to suboptimal feature representations, making it difficult for models to distinguish between subtle healthy variations and actual pathological anomalies.
Methodology
The proposed framework addresses these limitations by transitioning the detection pipeline into hyperbolic space, specifically utilizing the Lorentz model (a hyperboloid geometry).
1. Anomaly Synthesis
Because the model is trained exclusively on "normal" data, synthetic anomalies are generated to facilitate learning. Techniques include CutPaste (repositioning image patches), Gaussian Intensity shifts (to simulate tumors), and Source Deformation.
2. Feature Extraction and Projection
Features are extracted from a standard pre-trained backbone (WideResNet50). These Euclidean features are then projected onto a hyperboloid using an "exponential map." This transformation allows the model to operate within a geometry that naturally respects hierarchical relationships.
3. Hierarchical Aggregation and Classification
Rather than using simple averaging, the framework employs a weighted Lorentzian centroid. Features are weighted based on their distance from the origin in hyperbolic space; this distance serves as a proxy for hierarchical depth and confidence. Finally, a "hyperplane" is defined within this curved space to separate normal tissue from anomalies. A key innovation is that the curvature of the space is learnable, allowing the model to adapt its geometry to the specific characteristics of different medical datasets.
Experimental Setup
The study utilizes the BMAD (Benchmarks for Medical Anomaly Detection) suite, which provides a diverse range of imaging modalities:
- BraTS2021: Brain MRI (FLAIR sequences).
- BTCV + LiTs: Liver CT scans.
- RESC: Retinal OCT images for edema.
- OCT2017: Retinal disease classification.
- RSNA: Chest X-rays.
Key Insights
Geometry as an Inductive Bias
The fundamental insight of this work is that the mathematical space used for data representation acts as a powerful inductive bias. Hyperbolic space is mathematically "spacious" enough to represent hierarchies without the distortion found in flat Euclidean space, providing a more accurate map of anatomical features.
Geometric Confidence
In hyperbolic models, the distance from the origin correlates with the informativeness of a feature. By weighting features according to this distance during aggregation, the model naturally prioritizes high-confidence signals and ignores noise, leading to more robust detection.
The Few-Shot Advantage
One of the most significant findings is the model's performance in data-scarce environments. When only 1 or 5 healthy images are available for training, the geometric constraints of hyperbolic space prevent the model from over-fitting. This allows it to maintain high performance in scenarios where Euclidean baselines typically collapse.
Results
The hyperbolic approach consistently outperformed established Euclidean models, such as PatchCore and PaDiM, across multiple benchmarks:
- Image-Level Detection: On the RSNA (Chest X-ray) dataset, the hyperbolic model achieved an Image-AUROC of 79.46%, compared to 75.67% for PatchCore.
- Few-Shot Robustness: In single-sample training tests, the hyperbolic model maintained significantly higher AUROC scores than competitors.
- Stability: Ablation studies indicated that the model’s pixel-level localization (P-AUROC) remained stable even when features were compressed to very low dimensions, a task where Euclidean models often struggle.
Conclusion and Future Work
By swapping standard Euclidean geometry for hyperbolic space, this research provides a more effective way to capture the hierarchical nature of disease progression and anatomy. While the results are promising, future work could explore "fully hyperbolic" neural networks—where every convolution occurs in curved space—and the incorporation of earlier network layers to capture finer hierarchical details. Currently, this framework demonstrates that for medical anomaly detection, the shape of the space is just as important as the data itself.
Summary updated