Source-linked AI summary
Post-Anomaly Detection Inference for Deep SVDD
Cao Le Cong Thanh, Dang Quang Vinh, Vo Nguyen Le Duy
TL;DR
Deep SVDD anomaly decisions lack rigorous statistical guarantees, while testing instances selected as anomalous can produce invalid classical p-values and inflated FPR. PADI uses selective inference conditional on the detector’s selection event to produce valid p-values for a trained, frozen detector. The paper reports FPR control alongside strong detection power, and extends the procedure to Deep SAD.
Problem
Deep SVDD anomaly decisions lack rigorous statistical guarantees, and classical tests on detector-selected instances can have inflated FPR because they ignore selection.
Source: §1 · p. 2Method
PADI conditions inference on the Deep SVDD anomaly-selection event to derive selective p-values for a trained, frozen detector, using independent normal reference data.
Source: §1 · p. 2Results
PADI consistently achieves reliable FPR control while maintaining strong detection power on synthetic and real-world datasets.
Source: §8 · p. 16Takeaways & Limitations
The framework also extends to deep semi-supervised anomaly detection, providing inference for Deep SAD.
Source: §4 · p. 10, §8 · p. 16Exact finite-sample validity relies on the stated Gaussian test-reference model, independent normal references, fixed thresholds, and known or independently estimated covariance; it is not distribution-free.
Source: §7 · p. 16
Abstract
from arXiv · showhide
Deep Support Vector Data Description (Deep SVDD) has become a prominent framework for unsupervised anomaly detection by learning latent representations that compactly characterize normal data around a center. Despite its empirical success, anomaly decisions produced by Deep SVDD are typically made solely based on anomaly scores without rigorous statistical guarantees, thereby limiting their reliability in safety-critical and high-stakes applications where false positives must be strictly controlled. In this paper, we propose PADI (Post-Anomaly Detection Inference), a novel framework that equips a trained and frozen Deep SVDD detector with statistically valid inference by leveraging the Selective Inference framework. Specifically, PADI performs inference conditional on the event that a test instance is identified as anomalous by Deep SVDD, thereby enabling rigorous statistical assessment of anomaly decisions. Based on this formulation, we derive valid selective p-values that quantify the statistical significance of the detected anomaly. Using these p-values, we theoretically establish control of the false positive rate (FPR) at a user-specified significance level $\alpha$ (e.g., $\alpha=0.05$). Furthermore, we extend the proposed framework to Deep Semi-Supervised Anomaly Detection (Deep SAD), providing a principled approach for statistically reliable inference in semi-supervised anomaly detection settings. Extensive experiments on both synthetic and real-world benchmark datasets robustly support the theoretical findings. The results demonstrate that PADI consistently achieves proper FPR control while attaining superior true positive rates compared with existing approaches.
1 Introduction
Deep SVDD anomaly scores do not provide rigorous statistical guarantees, and testing anomalies selected by the detector can inflate false positives. The introduction presents PADI as a post hoc selective-inference framework and reports controlled FPR with stronger true positive rates in experiments.
1 Introduction
- Deep SVDD decisions lack rigorous statistical guarantees, and testing data-selected anomalies with classical p-values can inflate FPR through selection bias.The introduction identifies reliable uncertainty assessment and FPR control as important for high-stakes applications.Source: §1 · p. 2
- PADI conditions inference on Deep SVDD’s anomaly-selection event to derive selective p-values and theoretically control FPR at a user-specified significance level.It is post hoc and uses trained, frozen detectors without retraining or modification; inference requires independent normal reference data.Source: §1 · p. 2
- A GPU-accelerated implementation is presented to extend practical applicability beyond simple fully connected networks.The stated purpose is to alleviate the computational burden of post-anomaly-detection inference.Source: §1 · p. 2
- PADI consistently controls FPR while maintaining superior true positive rates on synthetic and real-world benchmark datasets.The introduction reports these experiments as validation of the proposed method.Source: §1 · p. 2
- The introduction situates PADI among prior anomaly-detection inference work and identifies Deep SVDD significance testing as unaddressed.It distinguishes the cited k-nearest-neighbor and domain-adaptation settings from this work’s conventional Deep SVDD setting.Source: §1 · p. 3
2 Problem Statement
The paper formulates post-detection inference for a fixed Deep SVDD detector: it tests whether a selected test instance differs from independent normal references. It explains the anomaly-selection event, the statistical model, and why ordinary p-values that ignore selection are invalid.
2 Problem Statement
- Post-AD inference tests whether a Deep SVDD-selected instance differs significantly from an independent reference set of observed normal instances, without modifying the trained detector.The detector is trained independently and remains fixed during test-time analysis.Source: §2 · p. 4
2.1 A trained Deep SVDD model and its anomaly detection event
- A fixed threshold τ selects a test instance as anomalous when its distance-based score g(x_test) is at least τ.The selection mapping assigns A(x_test) = 1 to selected anomalies and 0 to non-anomalous decisions; the same inference procedure applies to hard- and soft-boundary variants once the detector is fixed.Source: §2.1 · p. 4
2.2 Statistical hypothesis testing for the detected anomaly
- The test instance is modeled as an underlying signal plus Gaussian noise, and the null hypothesis equates its signal with the normal-reference signal.The covariance is assumed known or independently estimated; the ℓ1 statistic is motivated by the cited selective-inference framework’s linear-contrast requirement.Source: §2.2 · pp. 4–5
2.3 Decision making based on p-values and challenges
- A p-value at or below α leads to rejecting the null, but computing it after anomaly selection is intractable and ignoring selection yields invalid inference that fails to control FPR.The next section introduces a selective p-value satisfying the validity criterion.Source: §2.3 · p. 5
3 Proposed PADI Method
PADI computes selective p-values for anomalies detected by a trained, frozen Deep SVDD model by conditioning on the anomaly-selection event and associated data constraints. It reduces the required conditioning region to a tractable one-dimensional set, enabling validity assessment after selection.
3 Proposed PADI Method
- PADI conditions inference on the data-dependent anomaly-selection event rather than using the unconditional null distribution.It also conditions on the observed sign pattern and nuisance sufficient statistic to define the selective null distribution.Source: §3 · p. 5, §3.2 · p. 6
3.2 Conditional distribution of the test statistic and the proposed selective p-value
- Theorem 1 establishes that PADI’s selective p-value is valid under the stated inference formulation.The p-value conditions on the anomaly-selection event, the observed sign pattern, and a nuisance sufficient statistic.Source: §3.2 · p. 6
3.3 Tractable characterization of the conditioning event for selective p-value computation
- Theorem 2 reduces the conditioning set to a one-dimensional affine line, with admissible values represented by the truncation region Z.Once Z is characterized, the selective p-value can be computed directly in the scalar parameter space.Source: §3.3 · p. 7
3.4 Identification of the truncation region Z
- Z intersects the sign-pattern constraint with anomaly-selection values gathered across affine regions traversed by the test path.The sign constraint is a single interval; within each region, the anomaly-score condition is quadratic in the scalar parameter.Source: §3.4 · pp. 7–8
- PADI avoids conditioning on the observed affine-region identity, while the over-conditioning baseline uses only that region and may reduce statistical power.PADI searches across multiple intersected affine regions, making it more computationally demanding than the baseline.Source: §3.4 · p. 9
3.5 Algorithmic Summary of PADI
- Algorithm 1 constructs the conditioned line and truncation region, then returns a selective p-value and rejects the null when it is at most α.The procedure first checks whether the test instance is selected as anomalous; otherwise, it returns “not selected as anomalous.”Source: §3.5 · p. 10
4 Extension to Deep Semi-Supervised Anomaly Detection
PADI extends to Deep SAD because its frozen detector uses the same anomaly scoring rule and selection event as Deep SVDD. Under the piecewise-affine encoder assumption, its truncation region is a finite union of intervals and the same inference procedure applies.
4 Extension to Deep Semi-Supervised Anomaly Detection
- Deep SAD differs from Deep SVDD in training, but after training its frozen detector has the same anomaly-selection rule and post-selection inference structure.The inference procedure replaces the Deep SVDD encoder and truncation region with their Deep SAD counterparts.Source: §4 · pp. 10–11
- Under Assumption 1, the Deep SAD anomaly score is quadratic along each affine-region segment, yielding a truncation region that is a finite union of intervals.The same PADI procedure applies with the frozen Deep SAD encoder and its corresponding region ZSAD.Source: §4 · p. 10
5 GPU-Based Parallelization of PADI
PADI accelerates the line search needed to identify the selective truncation region with custom GPU kernels for fully connected and convolutional encoders. The CNN implementation parallelizes layer updates and local selection-constraint computation.
5 GPU-Based Parallelization of PADI
- PADI uses custom Numba-CUDA kernels to accelerate repeated forward propagation and feasible-interval updates during truncation-region identification.The implementation supports fully connected encoders and adds convolution, batch-normalization, max-pooling, and final fully connected kernels for CNN encoders.Source: §5 · p. 11
- For CNNs, GPU threads compute layer outputs and local activation or pooling constraints in parallel, then merge constraints to update the feasible interval.This avoids repeated CPU-side scans over feature-map elements and pooling windows.Source: §5 · p. 11
6 Experiments
Experiments compare PADI with over-conditioning, naive inference, and ablations across synthetic, tabular, and image data, while also evaluating a GPU implementation. Across these settings, PADI maintains FPR control and achieves higher TPR than OC; the CUDA implementation is faster than the PyTorch version.
6 Experiments
- Experiments compare PADI with OC, Naive, and two ablations at α = 0.05, using a threshold fixed to the empirical 95th percentile of normal training scores.The threshold is determined independently of test instances and reference samples used for post-selection inference.Source: §6 · p. 11
6.1 Synthetic Data Experiments
- For synthetic experiments, the inference reference set is sampled independently of test data; the study tests independent and correlated covariance structures.The FPR experiments vary sample size, while TPR experiments vary the signal shift Δ.Source: §6.1 · p. 12
- Across both synthetic covariance settings, PADI and OC control FPR around α = 0.05, while PADI achieves higher TPR than OC, with the gap increasing as Δ increases.Naive, Op1 without sign-pattern conditioning, and Op2 without the anomaly-selection event fail FPR control and are excluded from TPR comparisons.Source: §6.1 · pp. 12–13, Figure 4 · p. 13
- The Numba-CUDA implementation runs faster than PyTorch across tested encoder depths and input dimensions, with the runtime gap growing as encoder depth increases.Input dimensions range from 900 to 3600; runtime increases with dimensionality for both implementations.Source: §6.1 · pp. 13–14, Figure 5 · p. 14
6.2 Real-World Tabular Data Experiments
- Across all five evaluated tabular datasets, PADI and OC kept empirical FPR close to the target significance level, while Naive was severely inflated; PADI achieved higher TPR than OC on every dataset.Source: §6.2 · p. 14
6.3 Real-World Image Data Experiments
- Across five MVTec AD categories, PADI and OC control empirical FPR around the target, while PADI achieves higher TPR than OC.The evaluation is a patch-level proof of concept, not a comprehensive evaluation of all 15 categories; each 30×30 patch is labeled anomalous when at least 5% overlaps the defect mask.Source: §6.3 · p. 15
7 Limitations
PADI’s exact derivation has architectural and statistical scope boundaries, and its p-value concerns a particular input-space discrepancy rather than a universal notion of anomaly.
7 Limitations
- PADI’s exact derivation requires a piecewise-affine frozen encoder, a condition satisfied by standard ReLU-based ResNets.Architectures using GELU, Layer Normalization, or standard self-attention, including standard ViTs, are not directly covered.Source: §7 · pp. 15–16
- On MVTec AD, PADI maintains empirical FPR control and achieves higher TPR than OC across five image categories.Figure 7 compares empirical FPR for PADI, OC, and Naive; its TPR comparison covers the statistically valid methods.Source: Figure 7 · p. 16
- The FPR guarantee depends on the fixed-detector setting and the stated statistical model and assumptions; violations may miscalibrate p-values and invalidate control.The paper advises checking assumptions and conducting domain-specific validation before high-stakes deployment.Source: §7 · p. 16
- The exact finite-sample guarantee relies on a Gaussian test-reference model and required reference-sample and covariance assumptions, rather than being distribution-free.Extending the guarantee to more general distributions or relaxing these assumptions is left for future work.Source: §7 · p. 16
- PADI’s p-value measures the conditional significance of an input-space ℓ1 discrepancy, not a universal probability of anomaly or semantic abnormality.Tasks defined by high-level semantic differences may require another inferential target or test statistic.Source: §7 · p. 16
8 Conclusion
The paper concludes that PADI supplies valid p-values and FPR guarantees for frozen Deep SVDD detectors, with an extension to Deep SAD. Its proof applies Gaussian-conditioning results and constructs the PADI truncation region.
8 Conclusion
- PADI associates Deep SVDD anomalies with valid p-values, controls FPR at a user-specified level, and operates post hoc without retraining; the framework also extends to Deep SAD.Experiments on synthetic and real-world datasets show reliable FPR control with strong detection power.Source: §8 · p. 16
A Proofs of the main theorems
- The proofs use the conditional truncated-Gaussian validity argument and one-dimensional affine-line reduction from Lee et al. (2016), with PADI’s truncation-region construction as the application-specific step.The construction is detailed in Appendix B.Source: A Proofs of the main theorems · p. 20
A.1 Proof of Theorem 1
The appendix reduces selective inference to a one-dimensional truncation problem, characterizes the constraints defining that region, and describes GPU parallelization for encoder operations.
A.1 Proof of Theorem 1
- Under the null, conditioning yields a truncated normal distribution, and the probability integral transform gives the selective p-value its stated uniform distribution.The truncation region is a finite union of intervals.Source: §A.1 · p. 20
A.2 Proof of Theorem 2
- Conditioning on the nuisance component fixes it and leaves the scalar contrast z as the remaining randomness along a one-dimensional affine line.The proof uses the Gaussian model to establish this reduction.Source: §A.2 · pp. 20–21
B Characterization of the Truncation Region
- The truncation-region construction decomposes the affine-line data into test and normal-reference components before deriving its constraints.The appendix partitions the affine-line intercept and slope conformably into those components.Source: B Characterization of the Truncation… · pp. 21–22
B.1 Sign-pattern constraint
- The sign-pattern constraint preserves the coordinate signs used to linearize the ℓ1 discrepancy, reducing feasibility to linear inequalities in z.The feasible set is defined by one such inequality for each coordinate.Source: §B.1 · p. 22
B.2 Affine-region characterization of the frozen encoder
- Along the test-sample path, the frozen encoder’s affine regions are polytopes, and the z-values placing the sample in a region satisfy finitely many linear inequalities.The region constraints define Zregion(P).Source: §B.2 · p. 22
B.3 Deep SVDD selection constraint
- Within each affine region, the Deep SVDD anomaly-selection event becomes a quadratic inequality in the scalar z.This follows by substituting the encoder’s affine representation along the test-sample path into the anomaly score.Source: §B.3 · p. 23
C Details of GPU-Based Parallelization of PADI
- The GPU implementation parallelizes the line search and adds convolutional-encoder kernels, including local constraints for LeakyReLU and max-pooling selections.The convolutional extension also supports batch normalization and a final fully connected layer.Source: C Details of GPU-Based Parallelization… · pp. 23–25
D Experiments for the extension to Deep Semi-Supervised Anomaly Detection
The Deep SAD experiments define PADI, over-conditioning, and naive inference comparisons, alongside two ablations that remove different constraints.
D Experiments for the extension to Deep Semi-Supervised Anomaly Detection
- The Deep SAD comparison includes PADI, an over-conditioning baseline that also conditions on the frozen encoder’s observed affine region, and traditional naive inference.The over-conditioning truncation set is constructed from that region, analogously to ZOC.Source: D Experiments for the extension to… · p. 26
- Op1 ablates the sign-pattern constraint from the PADI extension to Deep SAD.Source: D Experiments for the extension to… · p. 26
- Op2 ablates the Deep SAD anomaly-detection event from the PADI extension.Source: D Experiments for the extension to… · p. 26
D.1 Synthetic Data Experiments
In synthetic Deep SAD experiments, PADI and OC control FPR while Naive and the two ablations do not. Among methods with valid FPR control, PADI achieves higher TPR than OC, especially as the signal difference grows.
D.1 Synthetic Data Experiments
- PADI and OC maintain FPR control in both covariance settings, and PADI achieves higher TPR than OC as the signal difference increases.The TPR gap grows for stronger anomaly signals.Source: §D.1 · p. 26
- Op1 fails FPR control without sign-pattern conditioning, while Op2 fails when it ignores the Deep SAD anomaly-selection event.Op1 cannot represent the ℓ1 statistic as the required linear contrast; Op2 leaves selection bias uncorrected.Source: §D.1 · p. 26
- Op2 shows greater FPR inflation than Op1 because it discards the anomaly-selection adjustment retained by Op1.Op1 remains invalid, but retaining the selection event can partially mitigate selection bias.Source: §D.1 · p. 26
D.2 Real Tabular Data
Across Deep SAD tabular and image experiments, PADI maintains FPR near the target and achieves higher TPR than OC. Additional tests report FPR control under non-Gaussian distributions and across reference-set sizes, with TPR largely consistent across those sizes.
D.2 Real Tabular Data
- Across real tabular datasets, PADI and OC control empirical FPR around the target, while PADI outperforms OC in TPR on all datasets.Naive shows large FPR inflation; the figure reports FPR and TPR for the Deep SAD extension.Source: §D.2 · p. 26, Figure 9 · p. 28
D.3 Real Image Data
- Across five MVTec AD image categories, PADI and OC maintain FPR around the target, and PADI achieves higher TPR than OC.The categories span regular-texture, random-texture, and object anomalies.Source: §D.3 · p. 28, Figure 10 · p. 28
E.1 Robustness to Non-Gaussian Data Distributions
- PADI maintains empirical FPR near the target across the tested skew-normal, Student’s t, and Laplace distributions, although its theoretical guarantee is derived under Gaussian assumptions.The tested settings use skew-normal shape 0.3, Student’s t with df = 7, and Laplace scale b = 0.8.Source: §E.1 · p. 29
E.2 Effect of the Reference Set Size
- Across reference-set sizes, empirical FPR remains close to α = 0.05 and TPR remains highly consistent.The study varies the reference set from 5 to 20 samples; increasing it beyond a reasonable number provides limited additional detection-performance improvement.Source: §E.2 · p. 29
E.3 Effect of Data Dimension on FPR Control
PADI maintains FPR control across the tested data dimensions and, among methods with valid FPR control, has higher TPR than OC. Runtime analysis identifies Phase II as the dominant cost, while a separate comparison measures training, standard inference, and selective inference.
E.3 Effect of Data Dimension on FPR Control
- Across the tested dimensions d ∈ {20, 40, 60, 80}, empirical FPR remains close to α = 0.05.The result holds across the considered sample sizes.Source: §E.3 · pp. 29–30, Figure 13 · p. 30
E.4 Additional Evaluation for Synthetic Experiments
- Among methods with valid FPR control, PADI consistently achieves higher TPR than OC as the signal difference increases.In both covariance settings, PADI and OC control FPR, whereas Naive, Op1, and Op2 produce inflated FPR; the latter methods’ higher TPR comes with uncontrolled FPR.Source: §E.4 · pp. 30–31
E.5 Runtime Breakdown of PADI
- Phase II dominates runtime across tested encoder depths because it uses iterative line search and repeated CNN forward passes to identify the feasible truncation region.Its runtime grows substantially as convolutional blocks increase; Phases I and III add relatively small overhead.Source: §E.5 · pp. 31–32
E.6 Runtime Breakdown: Training, Inference, and the Proposed PADI Method
- A separate runtime experiment compares Deep SVDD training, standard inference, and selective inference using four blocks on an NVIDIA Tesla P100 GPU.The results are presented in Table 2.Source: §E.6 · p. 32, Table 2 · p. 32