divyashekar/anomaly-reasoning
1
Explainable Vision-Based Industrial Intelligence for Zero-Shot Surface Anomaly Detection
This repository houses the production deployment version of the final MSc project for Zero-Shot Surface Anomaly Reasoning.
Architecture & Implementation Overview
- Backbone Network: DINOv2 (
dinov2_vitb14) loaded directly viatorch.hub. - Feature Fusion Matrix: Computes an unified global feature map via the precise notebook distribution weights: $$\text{Feature} = 0.55 \cdot \text{CLS} + 0.20 \cdot \text{Patch Mean} + 0.15 \cdot \text{Patch Max} + 0.10 \cdot \text{Patch Std}$$
- Statistical Calibration: Features are processed via a category-specific
RobustScalerandPCA(256 components) before executing a Mahalanobis matrix distance check for finalPASS/FAILverification. - Explainability Subspace: High-resolution patch tokens are translated directly through localized metrics mapping onto a 16x16 grid without dimension contamination, yielding complete, high-fidelity spatial anomaly heatmaps.
- Vision-Language Engine: Employs deterministic zero-shot distribution descriptions avoiding hallucinated defect categorization labels in conformance with true model limitations.
