DiMMAD: Multi-Metric Distance Anomaly Detection
- DiMMAD is a multi-metric anomaly detection method that aggregates diverse distance metrics on fixed-length astronomical feature vectors.
- It computes robust consensus scores by aggregating distances from class centroids using medians across multiple geometries.
- The method excels in high-confidence triage for surveys like LSST and ZTF, offering computational efficiency and intuitive interpretability.
Distance Multi-Metric Anomaly Detection (DiMMAD) is an anomaly detection method that uses an ensemble of distance metrics to find novelties in fixed-length feature spaces derived from astronomical time series. It was introduced for out-of-distribution anomaly detection in astronomical surveys, where irregular, multi-band light curves are first encoded into feature vectors and then scored by their distances to centroids of labeled seen classes under multiple geometries. The central idea is that each distance metric induces a different geometry on the feature space, so a truly novel object should remain far from known-class centroids across many geometries; DiMMAD therefore constructs a consensus anomaly score by aggregating per-metric distance evidence with robust medians rather than relying on any single distance definition (Chaini et al., 27 Oct 2025).
1. Problem domain and conceptual motivation
DiMMAD is designed for large synoptic surveys such as Rubin LSST and ZTF, where the raw inputs are irregular, multi-band astronomical light curves. In the reported pipeline, these time series are transformed into fixed-length feature vectors before anomaly detection is applied. The method targets the search for the “unknown unknowns,” meaning objects whose feature vectors occupy regions of the space not represented by the labeled training classes (Chaini et al., 27 Oct 2025).
A central distinction in the method is between out-of-distribution anomalies and rare in-distribution anomalies. Out-of-distribution anomalies are objects from novel classes not present in the labeled training set and are described as off-manifold; the examples given are transients when the model is trained on variables. Rare in-distribution anomalies are extreme or unusual instances within known classes and are described as on-manifold, such as rare subtypes of supernovae within a broader supernova family. DiMMAD is designed to excel at out-of-distribution discovery and to maximize the diversity of new classes found. For rare in-distribution anomaly detection, it performs similarly to other methods, but may allow for improved interpretability (Chaini et al., 27 Oct 2025).
The motivation for the method is explicitly geometric. Classical distance-based anomaly detection often depends on a single, user-selected distance metric such as Euclidean distance, which may be suboptimal in a complex, high-dimensional feature space. DiMMAD addresses this metric-selection problem by ensemble-averaging across diverse distance metrics. The rationale is that each metric induces a different geometry on the feature space, and that geometric consensus lowers the chance that artifacts or peculiarities of one metric dominate the anomaly ranking. The reported benefits include improved robustness to feature scaling, anisotropy, sparsity, and the presence of non-linear relationships (Chaini et al., 27 Oct 2025).
2. Formal definition and scoring rule
Let the labeled training set of seen classes be with labels , and let the unlabeled test set be . In the reported astronomy application, the features are derived from Supernova Parametric Model fits to light curves; for ELAsTiCC, across , and for ZTF, across (Chaini et al., 27 Oct 2025).
For each seen class , DiMMAD computes a class centroid
The paper uses class “centroids” without specifying mean vs. median; mean is standard. Distances are then computed from each test object to every class centroid under a set of 0 diverse metrics from DistClassiPy. Two metrics—Additive Symmetric 1 and Maryland Bridge—were removed to increase diversity and decrease redundancy. The correlation metric is included, “Kulczynski” is included, and correlation cannot be visualized meaningfully in 2D but is part of the set (Chaini et al., 27 Oct 2025).
The per-metric distance function is 2. The examples explicitly used include Euclidean, Minkowski 3, Manhattan, Chebyshev, Cosine distance, Correlation distance, Canberra, Bray–Curtis, and Kulczynski. Representative definitions are
4
5
6
and
7
For a test object 8, the classwise distances under metric 9 are
0
DiMMAD then performs class aggregation in one of two ways:
1
or
2
The final anomaly score is the robust median across metrics,
3
The reported experiments evaluate two variants: min-class, median-metric (“min–med”) and median-class, median-metric (“med–med”). The experiments aggregate raw distance values via medians and do not use learned weights; the median is relied upon for robustness to scale differences and outliers (Chaini et al., 27 Oct 2025).
| Variant | Class aggregation | Metric aggregation |
|---|---|---|
| min–med | 4 | median across metrics |
| med–med | 5 | median across metrics |
Selection is ranking-based rather than threshold-based in the main experiments. All test objects are ranked by 6 in descending order, and the top-7 objects are selected for follow-up. The diversity objective is measured as the number of unique unknown classes discovered among the top-8 anomalies,
9
No explicit diversity-reweighting is applied (Chaini et al., 27 Oct 2025).
3. Pipeline, feature extraction, and computational profile
The reported DiMMAD pipeline has four stages: data ingestion, feature extraction, train-time centroid construction, and test-time scoring. The input data are irregular multi-band photometric light curves. Feature extraction uses the Supernova Parametric Model through the ALeRCE pipeline, producing band-wise parametric features such as amplitudes, rise times, fall times, and scale parameters. For ELAsTiCC, the feature vector has 25 dimensions across 0; for ZTF, it has 14 dimensions across 1. The choice is described as being driven by fast computation and low failure rates, with a reported failure rate below 2 versus approximately 3 for other feature sets (Chaini et al., 27 Oct 2025).
At train time, centroids are computed from labeled seen classes, and the training set can optionally be balanced by downsampling larger classes to the smallest class size; this balancing was used in the experiments. At test time, for each object 4 and each metric 5, the algorithm computes 6 to all class centroids, reduces them by the chosen class aggregator, aggregates across metrics by median to obtain 7, and ranks objects by 8 descending (Chaini et al., 27 Oct 2025).
The method is computationally lightweight. Computing centroids is 9, and test scoring is
0
with 1 typically 2, giving overall complexity
3
This is explicitly described as lightweight compared to 4-NN density methods or deep encoders and as scaling well for streaming. The implementation is open source: DiMMAD is implemented within DistClassiPy, and the reproduction code is released in a separate repository (Chaini et al., 27 Oct 2025).
Interpretability is a formal part of the method. For any candidate anomaly, one can inspect 5 across metrics to determine which geometries flag it as far from known classes, and inspect 6 to determine which classes and metrics contribute most strongly to the anomaly evidence. The paper also notes feature-space projections such as PCA and tables of per-metric distances as aids to diagnosis and scientific follow-up (Chaini et al., 27 Oct 2025).
4. Empirical evaluation in astronomical surveys
The main empirical study uses two astronomy datasets. ELAsTiCC is a simulated LSST/Rubin dataset with 25 parametric features per object; the known classes used for training are four variable star classes—Cepheids, RR Lyrae, Delta Scuti, and Eclipsing Binaries—while the out-of-distribution unknowns are 34 transient classes, including supernovae and TDEs. ZTF uses ALeRCE features with 14 dimensions and 11 common variable or stochastic classes as knowns, with four supernova classes as out-of-distribution unknowns (Chaini et al., 27 Oct 2025).
Balanced training sets were formed by downsampling to the smallest class. The test sets deliberately included a high anomaly fraction of approximately 7, stratified across many out-of-distribution classes, to stabilize ranking comparisons. Robustness was also validated on highly imbalanced test sets with more than 8 inliers. The reported evaluation used 20 independent Monte Carlo runs with different seeds and reported mean 9 bands (Chaini et al., 27 Oct 2025).
The baselines were Isolation Forest, Local Outlier Factor, One-Class SVM, Autoencoders, and Multiclass Deep SVDD. Evaluation focused on purity@N, defined as precision@N, and the diversity of classes discovered, 0 (Chaini et al., 27 Oct 2025).
On ELAsTiCC out-of-distribution detection, both DiMMAD variants were reported as the best methods in the lower follow-up budget regime, maintaining significantly higher purity than competing methods. Within the first few hundred objects, DiMMAD kept purity above approximately 1 while competitors typically fell lower. DiMMAD also discovered a more diverse set of out-of-distribution classes more rapidly, yielding higher 2 than the baselines (Chaini et al., 27 Oct 2025).
On ZTF out-of-distribution detection, DiMMAD (min–med) was again the best-performing method in purity@N among the tested methods, while DiMMAD (med–med) was comparable to Isolation Forest and One-Class SVM. For rare in-distribution anomaly detection on the ELAsTiCC PISN-on-SN task, Isolation Forest often provided higher and more stable purity, while DiMMAD remained competitive but not best. The paper interprets this as consistent with the geometric-consensus hypothesis: DiMMAD prioritizes off-manifold out-of-distribution objects, whereas Isolation Forest isolates sparse points on-manifold (Chaini et al., 27 Oct 2025).
The appendix-level qualitative analysis further reports strong classwise performance for rare explosive transients such as Kilonovae KN_K17 and KN_B19, Superluminous SN SLSN-I+host, Calcium-rich CART, Strongly Lensed SN Ia (SL-SN1a), and Microlensing events (uLens). The same analysis also notes classes for which other methods can be comparable or better, including PISN and ILOT, and therefore states that no single anomaly detection approach is universally optimal (Chaini et al., 27 Oct 2025).
5. Relation to other anomaly-detection frameworks and naming ambiguity
The name DiMMAD has a specific meaning in astronomy: a multi-metric, centroid-based anomaly detector that aggregates per-metric distance evidence by medians (Chaini et al., 27 Oct 2025). A separate 2024 industrial anomaly detection framework, however, is named DMAD, standing for “Dual Memory bank enhanced representation learning for Anomaly Detection,” and the source explicitly states that the paper does not introduce a method named DiMMAD. If “Distance Multi-Metric Anomaly Detection (DiMMAD)” is being used to refer to DMAD’s distance-centric dual-memory design, then DiMMAD is closely related to DMAD; nonetheless, the two formulations are distinct (Hu et al., 2024).
The distinction is methodological. In DMAD, retrieval uses the Euclidean norm to find nearest neighbors in a normal memory and an abnormal memory, attention uses dot products, and the resulting signals are concatenated and mapped to anomaly scores with an MLP. The paper states that DMAD does not combine multiple classical distance metrics such as Euclidean, cosine, and Mahalanobis via weights; instead, it combines two distance sources to two distinct memories and an attention similarity signal. By contrast, DiMMAD explicitly uses an ensemble of classical distance metrics and aggregates them with robust medians (Hu et al., 2024).
A broader cross-domain pattern is visible across related work. OFA-TAD is described as operationalizing DiMMAD by extracting multi-view neighbor-distance patterns from multiple transformation-induced metric spaces and fusing them through a Mixture-of-Experts scoring network with entropy-regularized gating, under a one-for-all tabular anomaly detection setting (Li et al., 15 Mar 2026). AIDA combines a distance metric and an analytic isolation metric on distance profiles, yielding what the source describes as a “distance multi-metric” design without nearest-neighbor hyperparameters (Arias et al., 2022). Other reports connect DiMMAD-style reasoning to multidimensional Matrix Profile extensions for time series, to a distance-based subspace method driven by maximum subspace distance between covariance matrices, and to Mahalanobis-based multi-score detectors that combine multiple layerwise distances and ODIN-style confidence signals (Yeh et al., 2024, Huang et al., 2016, Kamoi et al., 2020). This suggests that the term can function both as the proper name of a particular astronomy method and, in a looser sense, as a design template for combining heterogeneous distance signals across domains.
6. Limitations, extensions, and practical deployment
The principal reported limitation of DiMMAD is that it is competitive but not best for rare in-distribution anomalies; in the ELAsTiCC PISN-on-SN task, Isolation Forest often achieved higher and more stable purity. The paper also states that metric choice still matters even though the ensemble reduces dependence on any single metric, that redundant metrics can dilute diversity, that preprocessing sensitivity remains important because performance depends on feature quality and robustness, and that simple class centroids may not capture complex multi-modal seen classes (Chaini et al., 27 Oct 2025).
The proposed future directions are adaptive metric weighting, metric learning, hybrid approaches combining DiMMAD with density estimation or deep representations, active learning for follow-up allocation, and diversity-aware re-ranking such as determinantal point processes. These are presented as natural extensions rather than parts of the reported experiments (Chaini et al., 27 Oct 2025).
The practical guidance given for new surveys is specific. Feature preparation should use robust, low-failure-rate, physically interpretable features; parametric light-curve features are presented as a strong baseline. If feature scales vary, per-dimension normalization such as standardization can help, even though median aggregation is robust. Training should assemble a labeled set of well-understood seen classes, balance classes by downsampling to the smallest class, and compute one centroid per class. Scoring should use approximately 16 diverse distance metrics, including Euclidean, Manhattan, Minkowski, Chebyshev, Cosine, Correlation, Canberra, Bray–Curtis, Kulczynski, and other continuous metrics available in DistClassiPy, while avoiding redundant metrics and excluding Additive Symmetric 3 and Maryland Bridge as in the paper. For class aggregation, the recommended starting point is min–med, based on the ZTF and ELAsTiCC results (Chaini et al., 27 Oct 2025).
Operationally, DiMMAD is intended for high-confidence triage. For LSST-scale follow-up, the paper recommends working in the “first few hundred” regime, where ELAsTiCC out-of-distribution purity remained above approximately 4. Newly confirmed classes can be incorporated by appending their centroids, and per-metric plus per-class distance explanations can support domain experts in follow-up decisions. For rare in-distribution searches, the paper recommends complementing DiMMAD with methods such as Isolation Forest or LOF (Chaini et al., 27 Oct 2025).
In this formulation, DiMMAD is both simple and constrained: it relies on explicit parametric features, centroid summaries of seen classes, and median-based aggregation of raw distances. Its contribution lies not in learned representation depth, but in the claim that multiple geometries can provide a robust consensus view of novelty, especially when the goal is not merely to detect unusual instances, but to maximize the diversity of genuinely new classes recovered from large astronomical surveys (Chaini et al., 27 Oct 2025).