%Version 3.1 December 2024
% See section 11 of the User Manual for version history
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                 %%
%% Please do not use \input{...} to include other tex files.       %%
%% Submit your LaTeX manuscript as one .tex document.              %%
%%                                                                 %%
%% All additional figures and files should be attached             %%
%% separately and not embedded in the \TeX\ document itself.       %%
%%                                                                 %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%\documentclass[referee,sn-basic]{sn-jnl}% referee option is meant for double line spacing

%%=======================================================%%
%% to print line numbers in the margin use lineno option %%
%%=======================================================%%

%%\documentclass[lineno,pdflatex,sn-basic]{sn-jnl}% Basic Springer Nature Reference Style/Chemistry Reference Style

%%=========================================================================================%%
%% the documentclass is set to pdflatex as default. You can delete it if not appropriate.  %%
%%=========================================================================================%%

%%\documentclass[sn-basic]{sn-jnl}% Basic Springer Nature Reference Style/Chemistry Reference Style

%%Note: the following reference styles support Namedate and Numbered referencing. By default the style follows the most common style. To switch between the options you can add or remove Numbered in the optional parenthesis. 
%%The option is available for: sn-basic.bst, sn-chicago.bst%  
 
%%\documentclass[pdflatex,sn-nature]{sn-jnl}% Style for submissions to Nature Portfolio journals
%%\documentclass[pdflatex,sn-basic]{sn-jnl}% Basic Springer Nature Reference Style/Chemistry Reference Style
\documentclass[pdflatex,sn-mathphys-num]{sn-jnl}% Math and Physical Sciences Numbered Reference Style
%%\documentclass[pdflatex,sn-mathphys-ay]{sn-jnl}% Math and Physical Sciences Author Year Reference Style
%%\documentclass[pdflatex,sn-aps]{sn-jnl}% American Physical Society (APS) Reference Style
%%\documentclass[pdflatex,sn-vancouver-num]{sn-jnl}% Vancouver Numbered Reference Style
%%\documentclass[pdflatex,sn-vancouver-ay]{sn-jnl}% Vancouver Author Year Reference Style
%%\documentclass[pdflatex,sn-apa]{sn-jnl}% APA Reference Style
%%\documentclass[pdflatex,sn-chicago]{sn-jnl}% Chicago-based Humanities Reference Style

%%%% Standard Packages
%%<additional latex packages if required can be included here>

\usepackage{graphicx}%
\usepackage{multirow}%
\usepackage{amsmath,amssymb,amsfonts}%
\usepackage{amsthm}%
\usepackage{mathrsfs}%
\usepackage[title]{appendix}%
\usepackage{xcolor}%
\usepackage{textcomp}%
\usepackage{manyfoot}%
\usepackage{booktabs}%
\usepackage{algorithm}%
\usepackage{algorithmicx}%
\usepackage{algpseudocode}%
\usepackage{listings}%
%%%%
\usepackage{anyfontsize}
\usepackage{makecell}
\usepackage{hyperref}
\usepackage{float}
\usepackage{pifont}
\usepackage{pgfplots}

\definecolor{myblue}{RGB}{70, 130, 180}   
\definecolor{myorange}{RGB}{242, 142, 43} 
\definecolor{myred}{RGB}{225, 87, 89} 
\pgfplotsset{compat=1.18}

%%%%%=============================================================================%%%%
%%%%  Remarks: This template is provided to aid authors with the preparation
%%%%  of original research articles intended for submission to journals published 
%%%%  by Springer Nature. The guidance has been prepared in partnership with 
%%%%  production teams to conform to Springer Nature technical requirements. 
%%%%  Editorial and presentation requirements differ among journal portfolios and 
%%%%  research disciplines. You may find sections in this template are irrelevant 
%%%%  to your work and are empowered to omit any such section if allowed by the 
%%%%  journal you intend to submit to. The submission guidelines and policies 
%%%%  of the journal take precedence. A detailed User Manual is available in the 
%%%%  template package for technical guidance.
%%%%%=============================================================================%%%%

%% as per the requirement new theorem styles can be included as shown below
\theoremstyle{thmstyleone}%
\newtheorem{theorem}{Theorem}%  meant for continuous numbers
%%\newtheorem{theorem}{Theorem}[section]% meant for sectionwise numbers
%% optional argument [theorem] produces theorem numbering sequence instead of independent numbers for Proposition
\newtheorem{proposition}[theorem]{Proposition}% 
%%\newtheorem{proposition}{Proposition}% to get separate numbers for theorem and proposition etc.

\theoremstyle{thmstyletwo}%
\newtheorem{example}{Example}%
\newtheorem{remark}{Remark}%

\theoremstyle{thmstylethree}%
\newtheorem{definition}{Definition}%

\raggedbottom
%%\unnumbered% uncomment this for unnumbered level heads

\begin{document}

\title{A  Pure Feature Refinement Framework for Industrial Anomaly Detection}

%%=============================================================%%
%% GivenName	-> \fnm{Joergen W.}
%% Particle	-> \spfx{van der} -> surname prefix
%% FamilyName	-> \sur{Ploeg}
%% Suffix	-> \sfx{IV}
%% \author*[1,2]{\fnm{Joergen W.} \spfx{van der} \sur{Ploeg} 
%%  \sfx{IV}}\email{iauthor@gmail.com}
%%=============================================================%%

\author[1]{\fnm{Chaoqun} \sur{Wang}}\email{20241081210203@buu.edu.cn}

\author[3]{\fnm{Wenjing} \sur{Zhang}}\email{zhangwenjing242@mails.ucas.ac.cn}

\author[2]{\fnm{Bo} \sur{Qi}}\email{20241083510910@buu.edu.cn}

\author[1]{\fnm{Xiaoyu} \sur{Huang}}\email{20242085410205@buu.edu.cn}
\author*[1]{\fnm{Ning} \sur{He}}\email{xxthening@buu.edu.cn}
\affil*[1]{\orgdiv{College of Smart City}, \orgname{Beijing Union University}, \orgaddress{\city{Beijing}, \country{China}}}

\affil[2]{\orgdiv{College of Robotics}, \orgname{Beijing Union University}, \orgaddress{\city{Beijing}, \country{China}}}

\affil[3]{\orgdiv{School of Engineering Science}, \orgname{University of Chinese Academy of Sciences}, \orgaddress{\city{Beijing}, \postcode{100049}, \country{China}}}

%%==================================%%
%% Sample for unstructured abstract %%
%%==================================%%

\abstract{Unsupervised industrial anomaly detection aims to localize unknown defects using only normal training samples. Recent reconstruction-based methods often rely on masked image modeling, heavy encoder-decoder designs, or multi-stage anomaly synthesis, which increase complexity and may sacrifice fine-grained spatial details. In this paper, we present a minimalist feature refinement framework that operates entirely in the semantic feature space. The proposed method uses a frozen DINOv2 backbone to extract multi-scale representations, applies a hyperspherical projection to stabilize feature magnitude, injects scale-aware feature jittering to reduce trivial identity mapping, and refines perturbed features with a lightweight unmasked attention module. For inference, we aggregate multi-layer anomaly maps with asymmetric fusion, Gaussian smoothing, and Top-K extrema scoring to improve robustness against noise and local outliers. Experiments on MVTec AD, BTAD, and UltraChip show that the proposed framework achieves competitive performance while maintaining a simple design and favorable efficiency.The code will be released at https://github.com/chaoqunWang666.}

%%================================%%
%% Sample for structured abstract %%
%%================================%%

% \abstract{\textbf{Purpose:} The abstract serves both as a general introduction to the topic and as a brief, non-technical summary of the main results and their implications. The abstract must not include subheadings (unless expressly permitted in the journal's Instructions to Authors), equations or citations. As a guide the abstract should not exceed 200 words. Most journals do not set a hard limit however authors are advised to check the author instructions for the journal they are submitting to.
% 
% \textbf{Methods:} The abstract serves both as a general introduction to the topic and as a brief, non-technical summary of the main results and their implications. The abstract must not include subheadings (unless expressly permitted in the journal's Instructions to Authors), equations or citations. As a guide the abstract should not exceed 200 words. Most journals do not set a hard limit however authors are advised to check the author instructions for the journal they are submitting to.
% 
% \textbf{Results:} The abstract serves both as a general introduction to the topic and as a brief, non-technical summary of the main results and their implications. The abstract must not include subheadings (unless expressly permitted in the journal's Instructions to Authors), equations or citations. As a guide the abstract should not exceed 200 words. Most journals do not set a hard limit however authors are advised to check the author instructions for the journal they are submitting to.
% 
% \textbf{Conclusion:} The abstract serves both as a general introduction to the topic and as a brief, non-technical summary of the main results and their implications. The abstract must not include subheadings (unless expressly permitted in the journal's Instructions to Authors), equations or citations. As a guide the abstract should not exceed 200 words. Most journals do not set a hard limit however authors are advised to check the author instructions for the journal they are submitting to.}

\keywords{Industrial Anomaly Detection, Hyperspherical Projection, Feature Reconstruction, Self-attention,DINOv2}

%%\pacs[JEL Classification]{D8, H51}

%%\pacs[MSC Classification]{35A01, 65L10, 65L12, 65L20, 65L70}

\maketitle

\section{Introduction}\label{sec1}

Industrial anomaly detection (IAD) is a fundamental task in automated inspection, where models are trained only on normal samples and must localize previously unseen defects at test time. In practice, industrial images often exhibit small defects, cluttered backgrounds, grayscale ambiguity, and spatial misalignment. These factors make robust localization difficult, especially when the anomaly occupies only a few pixels or is mixed with high-frequency noise.

Recent advances in IAD have largely benefited from pretrained visual representations. Existing methods can generally be categorized into memory-bank retrieval\cite{hyun2024reconpatch,lendering2026subspacead,lyu2024reb,xu2026mrad}, teacher--student distillation\cite{tien2023revisiting}, and reconstruction-based paradigms\cite{yang2024context}. Memory-bank methods (e.g., PatchCore\cite{roth2022towards}) achieve impressive performance on standard benchmarks by storing abundant normal features and performing nearest-neighbor retrieval during inference. However, their effectiveness relies heavily on the assumption that normal features can be well separated from anomalous regions in the embedding space. This assumption becomes less reliable in challenging industrial scenarios where background textures are highly cluttered, object boundaries are ambiguous, and appearance variations are substantial. Under such conditions, the stored memory may contain considerable background diversity, making feature retrieval less discriminative and increasing the likelihood of background responses.
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth]{motivation.png}
\caption{
Motivation of our reconstruction-based framework.
On challenging industrial images from the UltraChip dataset, the dense background textures and ambiguous foreground--background boundaries reduce the discriminative capability of memory-bank retrieval methods such as PatchCore.
Benefiting from the stronger semantic representations learned by DINOv2 and feature-space reconstruction, our method effectively suppresses background interference and produces more accurate anomaly localization with clearer object-background separation.
}
\label{fig:motivation}
\end{figure}
Figure~\ref{fig:motivation} illustrates this challenge. On the UltraChip dataset, which contains dense circuit textures, grayscale ambiguity, and significant structural variations, memory-bank retrieval often activates irrelevant background regions, leading to less accurate localization. In contrast, reconstruction in semantic feature space focuses on modeling the intrinsic distribution of normal features instead of searching among stored feature prototypes, making it inherently less sensitive to background diversity. Furthermore, while CNN backbones such as ResNet provide efficient local feature extraction, recent self-supervised Vision Transformers, exemplified by DINOv2~\cite{oquab2023dinov2}, learn substantially richer semantic representations with stronger global contextual awareness. These properties make DINOv2 particularly suitable for distinguishing subtle defects from visually similar background structures in complex industrial images.

Motivated by these observations, we revisit feature-space reconstruction from a minimalist perspective. Rather than relying on feature retrieval or image reconstruction, our method directly refines multi-scale semantic representations extracted by a frozen DINOv2 backbone. We introduce hyperspherical projection to normalize feature magnitude and stabilize optimization. To avoid trivial identity mapping without resorting to masking strategies, we perturb normalized features using scale-aware feature jittering during training. The perturbed representations are refined through a lightweight unmasked attention module that preserves long-range contextual interactions while maintaining a compact architecture. During inference, multi-scale anomaly maps are fused using an asymmetric aggregation strategy together with Gaussian smoothing and Top-K scoring, producing robust localization under challenging industrial conditions.
The main contributions are summarized as follows:
\begin{itemize}[leftmargin=0.1em]
\item We propose a minimalist feature refinement framework for IAD that operates in semantic feature space and avoids heavy masked reconstruction or large decoder designs.
\item We introduce hyperspherical projection and cosine-based optimization to stabilize feature refinement and focus learning on directional consistency rather than feature magnitude.
\item We design scale-aware feature jittering and a lightweight unmasked attention bottleneck to mitigate trivial identity mapping while preserving global feature interactions.
\item We develop a robust multi-scale inference strategy with asymmetric fusion, Gaussian smoothing, and Top-K extrema aggregation, which improves localization stability under noisy industrial conditions.
\item We validate the method on MVTec AD, BTAD, and UltraChip, and provide ablation studies and efficiency analysis to examine the effect of each component.
\end{itemize}

\section{Related Work}\label{sec2}

\subsection{Reconstruction-based Industrial Anomaly Detection}

Reconstruction-based IAD methods learn normal patterns from anomaly-free data and detect anomalies by measuring reconstruction error.\cite{iqbal2024multi,yao2023focus,zhang2024realnet} Early autoencoder-based methods are simple but often suffer from identity mapping, where anomalous regions are reconstructed too well. To address this issue, many recent methods introduce masked modeling, pseudo-anomaly generation, or asymmetric architectures\cite{li2021cutpaste,rohrich2025masked}. While these designs improve anomaly sensitivity, they also increase training complexity and may remove local details that are useful for precise localization.

\subsection{Feature Embedding and Memory-Based Methods}

Feature-embedding methods such as PaDiM\cite{defard2021padim} and PatchCore\cite{roth2022towards} exploit pretrained representations and build a normal feature profile for anomaly scoring. These methods are strong on standard benchmarks, but memory consumption and inference latency may become problematic when the stored feature set is large. In addition, nearest-neighbor retrieval can be sensitive to distribution shifts in noisy real-world settings.

\subsection{Teacher-Student and Transformer-Based Methods}

Teacher-student methods learn anomaly-aware discrepancies by matching teacher and student features\cite{tien2023revisiting}. Transformer-based approaches have also been widely used due to their strong long-range dependency modeling. However, many transformer-based IAD methods still rely on large backbones, multi-branch designs, or auxiliary training objectives\cite{lee2026uniformaly,luo2025exploring,guo2025dinomaly}. In contrast, our method keeps the architecture simple and focuses on feature refinement in a frozen pretrained representation space.

\section{Method}\label{sec3}

\subsection{Overview}

Figure~\ref{fig:overview} illustrates the proposed framework. Given an input image, a frozen DINOv2 backbone extracts multi-scale token features from selected intermediate layers. Each layer-specific feature map is first projected onto a unit hypersphere, then perturbed by scale-aware jittering during training. A lightweight unmasked attention module refines the perturbed features. At inference time, anomaly maps are computed using cosine distance, followed by multi-scale fusion, Gaussian smoothing, and Top-K aggregation to obtain robust image-level scores.

\begin{figure}[t]
    \centering
    \includegraphics[width=\linewidth]{framework.png}
    \caption{Overview of the proposed minimalist feature refinement framework.}
    \label{fig:overview}
\end{figure}

\subsection{Multi-Scale Feature Extraction}
Let $x \in \mathbb{R}^{3 \times H \times W}$ denote an input image. We employ a frozen DINOv2 backbone to extract intermediate token embeddings. While recent state-of-the-art anomaly detection methods, such as Dinomaly\cite{guo2025dinomaly} and INP-Former\cite{luo2025exploring}, heavily rely on dense feature extraction across a broad range of continuous layers (e.g., layers 2 through 9) followed by complex hierarchical fusion, such practices inevitably introduce severe feature redundancy and high computational overhead. 

In contrast, we propose a highly targeted, sparse extraction strategy utilizing only layers $\{2, 5, 8\}$. This design is driven by three key insights: 
(1) \textbf{Feature Orthogonality:} Consecutive layers in Vision Transformers tend to exhibit high representational similarity. By sampling at distinct intervals, we mitigate redundancy and capture a diverse, non-overlapping hierarchy encompassing shallow texture details (layer 2), mid-level structural patterns (layer 5), and deeper semantics (layer 8). 
(2) \textbf{Spatial Fidelity:} Extracting features too deep in the network (e.g., layer 9 and beyond) can lead to the over-smoothing of fine-grained spatial inductive biases, which are critical for localizing subtle industrial defects. Layer 8 serves as an optimal tipping point that preserves both spatial acuity and high-level semantics. 
(3) \textbf{Computational Efficiency:} Our sparse tri-level selection drastically reduces the dimensionality and memory footprint of the extracted feature maps. This allows our downstream network to achieve highly competitive, if not superior, detection performance while maintaining a significantly lighter architecture compared to dense-fusion counterparts.

For each selected layer $l$, we reshape the token sequence into a feature map:
\begin{equation}
F_l \in \mathbb{R}^{C \times h \times w}.
\end{equation}

To reduce local misalignment and suppress small spatial noise, a $3\times 3$ average pooling operation is applied:
\begin{equation}
\hat{F}_l = \mathrm{AvgPool}(F_l).
\end{equation}

\subsection{Hyperspherical Projection}

The representations extracted by DINO are inherently more suitable for angular similarity measurement than Euclidean distance. Although semantically similar features usually share highly consistent directions, their feature norms may vary considerably due to differences in local appearance, illumination, and Transformer activation responses. Consequently, directly computing Euclidean distances introduces unnecessary magnitude bias, causing semantically similar normal features to appear artificially distant in the embedding space.

To preserve the intrinsic geometry of the DINO feature manifold, we first normalize every pooled feature onto the unit hypersphere,

\begin{equation}
\bar{F}_l=\frac{\hat{F}_l}{\|\hat{F}_l\|_2+\epsilon},
\label{eq:hmp}
\end{equation}

where $\epsilon$ is a small constant for numerical stability.

This hyperspherical projection removes feature-scale variation and converts similarity estimation into a purely angular comparison. Consequently, cosine similarity becomes a faithful measure of semantic consistency, allowing the subsequent reconstruction module to learn compact normal feature distributions while producing more discriminative anomaly representations. In practice, this normalization substantially improves matching precision and stabilizes feature reconstruction in the high-dimensional DINO embedding space.

\subsection{Layer-Adaptive Feature Jittering}

To prevent the network from learning a trivial identity mapping during training, we inject stochastic perturbation into the normalized features. As illustrated in Fig.\ref{fig:overview} (b):
\begin{equation}
\tilde{F}_l = \bar{F}_l + \alpha \cdot \sigma_l \cdot \epsilon, \quad \epsilon \sim \mathcal{N}(0, I),
\label{eq:jitter}
\end{equation}
where $\alpha$ controls the base perturbation strength, and $\sigma_l$ functions as a layer-dependent adaptive scalar rather than a local instance norm. As the projected features $\bar{F}_l$ share a uniform L2 norm, applying a dynamic local magnitude scale is counterintuitive. Instead, $\sigma_l$ is strategically calibrated to the intrinsic angular variance of the specific layer $l \in \{2,5,8\}$. This layer-adaptive design ensures that both sparse shallow texture embeddings and dense deep semantic spaces receive appropriately scaled angular perturbations on the hypersphere. In our experiments, $\alpha=0.05$ yields optimal performance across datasets.

Compared with masking-based methods, this continuous perturbation is lightweight and keeps the full token sequence intact, ensuring no critical spatial structural content is discarded before refinement.

\subsection{Lightweight Unmasked Attention Refinement}

We introduce a compact attention-based module dedicated to refining the perturbed features. As illustrated in Fig.\ref{fig:overview} (c): unlike heavily parameterized decoder designs, this module directly operates on the intact token sequence without relying on masking. For each selected layer, the module maps the noisy embedding $\tilde{F}_l$ to a clean, refined feature map $R_l$:
\begin{equation}
R_l = \mathcal{R}(\tilde{F}_l).
\label{eq:refine}
\end{equation}

Since the features are bounded on the unit hypersphere, the training objective is naturally formulated as a cosine reconstruction loss:
\begin{equation}
\mathcal{L}_l = 1 - \frac{1}{N}\sum_{i=1}^{N} \frac{\langle R_l^i, \bar{F}_l^i \rangle}{\|R_l^i\|_2 \cdot \|\bar{F}_l^i\|_2 + \epsilon}.
\label{eq:loss_l}
\end{equation}

The total refinement loss is the summation over the explicitly selected layers:
\begin{equation}
\mathcal{L} = \sum_{l \in \{2,5,8\}} \mathcal{L}_l.
\label{eq:loss_total}
\end{equation}

\subsection{Anomaly Map Generation}

During inference, the refined features are compared with the normalized inputs using cosine distance:
\begin{equation}
S_l = 1 - \cos(\bar{F}_l, R_l).
\end{equation}

Each layer score is upsampled to the input resolution and fused by weighted summation:
\begin{equation}
S = \sum_{l \in \{2,5,8\}} w_l \cdot \mathrm{Up}(S_l).
\end{equation}

To reduce high-frequency noise, we apply Gaussian smoothing:
\begin{equation}
S \leftarrow G_{\sigma} * S.
\end{equation}

Finally, we use Top-K extrema aggregation to compute the image-level score:
\begin{equation}
s_{\mathrm{img}} = \frac{1}{K}\sum_{k=1}^{K} s^{(k)},
\end{equation}
where $s^{(k)}$ denotes the $k$-th largest pixel score in the flattened anomaly map.

% \section{Experiments}\label{sec4}
% \subsection{Experimental Setup}

% \textbf{Datasets.} 
% To comprehensively evaluate the robustness and generalizability of our proposed method, we conduct extensive experiments on three distinct industrial anomaly detection datasets. 
% 1) \textbf{MVTec AD}\cite{bergmann2019mvtec}: A standard benchmark containing 15 categories of industrial products, widely used to evaluate basic detection performance. 
% 2) \textbf{BTAD}\cite{mishra2021vt}: Comprises 3 categories of real-world industrial scenarios, heavily utilized to assess the model's environmental robustness. 
% 3) \textbf{UltraChip}\cite{11372587}: A highly challenging dataset focusing on micro-defect detection in semiconductor chips, which we employ to validate our method's generalization capability on extremely fine-grained microscopic anomalies.

% \textbf{Evaluation Metrics.}
% Following standard anomaly detection protocols, we employ three widely-accepted metrics to quantitatively evaluate our model. We use Image-level Area Under the Receiver Operating Characteristic Curve (I-AUC) for anomaly classification, Pixel-level Area Under the ROC (P-AUC) to assess anomaly localization precision, and Per-Region Overlap (PRO) to measure the region-wise overlap rate of the predicted anomalous areas.

% \textbf{Implementation Details.}
% Most of our experiments are conducted on a single NVIDIA V100 GPU (24GB).All input images are uniformly resized to $448 \times 448$. To construct a multi-scale receptive field, we extract intermediate features from the 2nd, 5th, and 8th layers of the encoder.During the inference stage, we perform a topological smoothing operation using a Gaussian filter with a constant standard deviation ($\sigma=1.5$) to suppress background noise, and establish robust image-level anomaly scores by calculating the mean of the Top-$K$ ($K=100$) extreme values.

% \subsection{Comparison with State-of-the-Art Methods}
% To comprehensively evaluate our framework, we integrate quantitative metrics and qualitative visualizations. We first benchmark our method on the highly challenging real-world dataset, and subsequently verify its generalizability on standard IAD benchmarks.

% \textbf{Performance on Real-World UltraChip Dataset.}
% We prioritize the evaluation on the UltraChip dataset, which poses extreme challenges due to severe structural noise, limited labeled data, and highly diverse, visually imperceptible microscopic defects. As summarized in Table \ref{tab:ultrachip_detail}, while traditional methods suffer sharp performance degradation from heavy background interference, our method successfully maintains a state-of-the-art mean Image-AUC of 81.9\%. Notably, our approach outperforms recent models like URD and SuperSimpleNet by significant margins. Furthermore, as demonstrated perfectly in the qualitative results in Figure \ref{fig:ultrachip_vis}, our framework precisely highlights actual defect areas without being inundated by widespread false-positive background noise (avoiding massive "red" regions), proving its exceptional capability to extract intrinsic normal patterns in non-ideal industrial environments.
% \begin{table}[!ht]
% \centering
% \caption{Detailed quantitative comparison on the UltraChip dataset. We report the performance across all three specific chip categories.}
% \label{tab:ultrachip_detail}
% \small % 1. 缩小字号，这是在不改动表头的情况下最有效的办法
% \setlength{\tabcolsep}{3.5pt} % 2. 减小列间距，默认通常是 6pt，这里压缩到 3.5pt
% \begin{tabular}{@{}lcccccccccccc@{}}
% \toprule
% Class & \multicolumn{3}{c}{Four-Lead} & \multicolumn{3}{c}{Bonding} & \multicolumn{3}{c}{Two-Lead} & \multicolumn{3}{c}{Mean} \\
% \cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(lr){8-10} \cmidrule(l){11-13}
% Method & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO \\
% \midrule
% REB\cite{lyu2024reb} & 64.0 & 83.2 & 33.9 & 83.2 & 0.285 & 43.6 & 66.1 & 87.3 & 33.2 & 71.1 & 68.3 & 36.9 \\
% FUNAD\cite{im2025fun} & 72.5 & 82.5 & 39.0 & 85.1 & 94.8 & 44.5 & 76.4 & 81.4 & 29.5 & 78.0 & 86.2 & 37.6 \\
% RAS\cite{yang2024context} & 77.9 & 87.7 & 36.0 & 64.9 & 80.6 & 44.4 & 77.7 & 76.4 & 29.2 & 73.5 & 81.6 & 36.5 \\
% MSFR\cite{iqbal2024multi} & 36.7 & 55.4 & 19.6 & 53.6 & 57.4 & 16.4 & 50.1 & 51.5 & 18.5 & 46.8 & 54.8 & 18.1 \\
% FOD\cite{yao2023focus} & 79.1 & 80.2 & 32.6 & 79.9 & 89.0 & 54.7 & 79.8 & 74.9 & 18.6 & 79.6 & 81.3 & 35.3 \\
% RD++\cite{tien2023revisiting} & 71.9 & 84.7 & 50.8 & 64.2 & 86.1 & 41.4 & 77.7 & 83.9 & 44.7 & 71.2 & 84.9 & 45.6 \\
% HGAD\cite{yao2024hierarchical} & 74.3 & 83.5 & 46.6 & 78.1 & 88.8 & 43.1 & 75.8 & 83.2 & 27.5 & 76.0 & 85.1 & 39.1 \\
% SuperSimpleNet\cite{rolih2024supersimplenet} & 72.9 & 67.1 & 40.3 & 78.0 & 81.5 & 56.2 & 79.4 & 68.7 & 33.2 & 76.8 & 72.5 & 43.2 \\
% URD\cite{liu2025unlocking} & 66.7 & 82.6 & 29.4 & 86.8 & 95.5 & 62.8 & 68.8 & 79.2 & 21.5 & 74.1 & 85.7 & 37.9 \\
% DiNomaly\cite{guo2025dinomaly} & 83.9 & 83.9 & 47.6 & 64.9 & 87.6 & 48.1 & 80.3 & 84.6 & 44.4 & 76.4 & 85.4 & 46.7 \\
% Subspace\cite{lendering2026subspacead} & 73.5 & 85.5 & 34.1 & 27.6 & 73.1 & 42.9 & 55.7 & 85.3 & 29.6 & 52.3 & 81.3 & 35.5 \\
% \textbf{Ours} & \textbf{80.1} & \textbf{84.3} & \textbf{45.7} & \textbf{82.5} & \textbf{92.3} & \textbf{58.9} & \textbf{83.3} & \textbf{82.2} & \textbf{34.6} & \textbf{81.9} & \textbf{86.3} & \textbf{46.4} \\
% \botrule
% \end{tabular}
% \end{table}

% \begin{figure*}[!htbp]
%   \centering
%   \includegraphics[width=0.95\textwidth, keepaspectratio]{fig6.png}
%   \caption{Qualitative comparison of anomaly localization on the challenging UltraChip dataset.}
%   \label{fig:ultrachip_vis}
% \end{figure*}
% \textbf{Generalizability on Standard Benchmarks (MVTec AD \& BTAD).}
% To prove that our method does not overfit to specific noisy datasets, we benchmark it on the standard MVTec AD and BTAD datasets. As presented in Table \ref{tab:mvtec_results} \ref{tab:auc_comparison} , despite its architectural minimalism, our method achieves the most comprehensive performance on MVTec AD, securing the highest scores across all two metrics (99.2\% P-AUC, and 96.0\% PRO). This represents a clear improvement over SOTA methods like Dinomaly and Subspace. To intuitively demonstrate this, Figure \ref{fig:mvtec_vis} shows that our generated heatmaps align tightly with ground-truth masks with almost zero background noise. Moreover, Table \ref{tab:btad_results} confirms our robustness against varying lighting and complex topologies typical of factory settings in the BTAD dataset, where we maintain a consistent advantage in average metrics (97.3\% I-AUC).
% \begin{table}[!htbp]
% \centering
% \caption{Quantitative comparison on the MVTec AD dataset.}
% \label{tab:mvtec_results}
% % 此处 0.85\columnwidth 控制表格大小，可自行微调（如 0.9 或 0.8）
% \begin{tabular}{lccc}
% \toprule
% Method & I-AUC & P-AUC & PRO \\
% \midrule
% REB\cite{lyu2024reb} & 99.1 & 98.4 & 92.5 \\
% URD\cite{liu2025unlocking} & 98.7 & 98.8 & 96.0 \\
% SuperSimpleNet\cite{rolih2024supersimplenet} & 97.4 & 98.5 & 91.0 \\
% FUNAD\cite{im2025fun} & 99.2 & 98.1 & 94.2 \\
% RD++\cite{tien2023revisiting} & 98.2 & 99.2 & 94.9 \\
% FOD\cite{yao2023focus} & 98.9 & 98.3 & 93.5 \\
% HGAD\cite{yao2024hierarchical} & 98.4 & 97.9 & 94.2 \\
% RAS\cite{yang2024context} & 98.5 & 97.5 & 93.9 \\
% MSFR\cite{iqbal2024multi} & 98.4 & 97.3 & 93.0 \\
% Dinomaly \cite{guo2025dinomaly} & 99.6 & 98.3 & 94.8 \\
% Subspace \cite{lendering2026subspacead} & 99.1 & 98.1 & 94.9 \\
% \midrule
% \textbf{Ours} & \textbf{99.5} & \textbf{99.2} & \textbf{96.0} \\
% \bottomrule
% \end{tabular}
% \end{table}


% % 新增的 MVTec 可视化图片代码 (如果图片较大，可将 figure 换为 \begin{figure*}[htpb])
% \begin{figure}[!htbp]
%   \centering
%   \includegraphics[width=\linewidth]{fig4.png} % 请将此处替换为您的实际图片名称和路径
%   \caption{Qualitative anomaly localization results of our proposed method on the MVTec AD dataset. For each category, we present the raw input image, the ground-truth anomaly mask, and the highly precise anomaly heatmap generated by our framework.}
%   \label{fig:mvtec_vis}
% \end{figure}
% \begin{table}[htbp]
%     \centering
%     \caption{MVTec Performance Metrics (AUC) --- DINOv3 vs. DINOv3+MVPI Results}
%     \label{tab:auc_comparison}
%     \renewcommand{\arraystretch}{1.2}
%     \begin{tabular}{lcccccc}
%         \toprule
%         \textbf{Category} & 
%         \multicolumn{3}{c}{\textbf{DINOv3}} & 
%         \multicolumn{3}{c}{\textbf{DINOv3+MVPI}} \\
%         \cmidrule(lr){2-4} \cmidrule[\heavyrulewidth](lr){5-7}
%         & \textbf{I-AUC} & \textbf{P-AUC} & \textbf{PRO} &
%           \textbf{I-AUC} & \textbf{P-AUC} & \textbf{PRO} \\
%         \midrule
%         hazelnut   & 100.0 & 99.5 & 96.7 & 100.0 & 99.5 & 96.9 \\
%         metal\_nut & 100.0 & 99.4 & 97.1 & 100.0 & 99.3 & 97.0 \\
%         bottle     & 100.0 & 99.2 & 94.0 & 100.0 & 99.2 & 97.0 \\
%         cable      & 99.7  & 99.2 & 99.0 & 99.7  & 99.1 & 99.5 \\
%         capsule    & 98.4  & 99.3 & 89.0 & 98.7  & 99.3 & 89.2 \\
%         carpet     & 100.0 & 99.7 & 98.3 & 100.0 & 99.7 & 98.0 \\
%         grid       & 100.0 & 99.1 & 96.3 & 100.0 & 99.2 & 96.0 \\
%         leather    & 100.0 & 99.4 & 98.4 & 100.0 & 99.5 & 98.5 \\
%         pill       & 98.3  & 98.7 & 96.9 & 98.6  & 99.0 & 97.1 \\
%         screw      & 95.1  & 99.3 & 95.8 & 98.6  & 99.5 & 96.5 \\
%         tile       & 100.0 & 98.8 & 95.5 & 100.0 & 98.8 & 95.7 \\
%         toothbrush & 100.0 & 99.2 & 89.8 & 100.0 & 99.3 & 92.5 \\
%         transistor & 99.7  & 98.7 & 96.3 & 99.7  & 98.5 & 96.3 \\
%         wood       & 97.5  & 97.0 & 92.1 & 97.5  & 97.0 & 92.3 \\
%         zipper     & 99.9  & 98.9 & 96.4 & 99.9  & 99.3 & 97.6 \\
%         \midrule[\heavyrulewidth]
%         \textbf{Mean} & \textbf{99.2} & \textbf{99.0} & \textbf{95.4} &
%                         \textbf{99.5} & \textbf{99.2} & \textbf{96.0} \\
%         \bottomrule
%     \end{tabular}
% \end{table}

% % Table 2: BTAD Results
% \begin{table}[htbp] 
% \centering
% \caption{Quantitative comparison on the BTAD dataset per class.}
% \label{tab:btad_results}
% \begin{tabular}{c|ccc|ccc|ccc|ccc}
% \hline
% Class & \multicolumn{3}{c|}{Class 01} & \multicolumn{3}{c|}{Class 02} & \multicolumn{3}{c|}{Class 03} & \multicolumn{3}{c}{Average} \\
% \hline
% Method & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO \\
% \hline
% FOD\cite{yao2023focus} & 95.8 & 97.0 & 62.2 & 96.2 & 97.8 & 65.4 & 96.0 & 97.7 & 99.0 & 96.0 & 97.5 & 75.5 \\
% Subspace\cite{lendering2026subspacead} & 100 & 98.9 & 84.7 & 91.2 & 96.8 & 80.4 & 99.6 & 98.5 & 56.1 & 96.9 & 98.0 & 73.7 \\
% Dinomaly\cite{guo2025dinomaly} & 96.4 & 97.2 & 74.0 & 89.1 & 96.5 & 56.6 & 99.8 & 99.8 & 99.3 & 95.1 & 97.9 & 76.6 \\
% REB\cite{lyu2024reb} & 99.6 & 94.7 & 70.0 & 88.5 & 95.6 & 66.4 & 99.8 & 99.7 & 80.6 & 96.0 & 97.2 & 72.4 \\
% HGAD\cite{yao2024hierarchical} & 92.6 & 94.9 & 70.5 & 93.3 & 96.7 & 59.3 & 97.0 & 99.1 & 97.9 & 94.1 & 96.9 & 75.9 \\
% RAS\cite{yang2024context} & 92.7 & 96.9 & 70.3 & 92.3 & 94.7 & 55.5 & 99.1 & 99.0 & 99.0 & 94.7 & 97.0 & 74.9 \\
% \textbf{Ours} & \textbf{99.4} & \textbf{97.1} & \textbf{72.6} & \textbf{93.4} & \textbf{97.5} & \textbf{62.3} & \textbf{100.0} & \textbf{99.7} & \textbf{98.8} & \textbf{97.6} & \textbf{98.1} & \textbf{77.9} \\
% \hline
% \end{tabular}
% \end{table}
% \subsection{Ablation Studies}
% To rigorously validate the efficacy of each proposed module and verify the rationality of our structural design, we conduct comprehensive ablation studies on the MVTec AD datasets.
% \begin{table}[!ht]
%     \centering
%     \caption{Ablation study on feature layer selection for the \textit{screw} category.}
%     \label{tab:ablation_screw}
%     \renewcommand{\arraystretch}{1.2} % 增加行高，使表格更易读
%     \begin{tabular}{cccc}
%         \toprule
%         \textbf{Feature Layers} & \textbf{I-AUC} & \textbf{P-AUC} & \textbf{PRO} \\
%         \midrule
%         $\{3, 6, 9\}$           & 93.9          & \textbf{99.3} & 95.6 \\
%         $\{4, 7, 10\}$          & 92.7          & 99.2          & 95.7 \\
%         $\{2, 5, 8\}$           & \textbf{95.2} & 99.2          & \textbf{95.8} \\
%         \bottomrule
%     \end{tabular}
% \end{table}

% % ==================== 分析段落部分 ====================
% \noindent
% As demonstrated in Table~\ref{tab:ablation_screw}, we conducted an ablation study to evaluate the impact of different feature layer combinations from DINOv3 on anomaly detection performance for the \textit{screw} category. 
% The configuration utilizing layers $\{2, 5, 8\}$ achieves the highest I-AUC (95.2\%) and PRO (95.8\%), while maintaining a competitive P-AUC (99.2\%). 
% Although the $\{3, 6, 9\}$ setting yields a marginally superior P-AUC (99.3\%), it suffers from a noticeable degradation in image-level discrimination (I-AUC drops by 1.3\%). 
% We attribute the superior overall performance of layers $\{2, 5, 8\}$ to their balanced representation: this specific combination effectively captures fine-grained shallow texture and structural details from the early layers, while simultaneously preserving rich high-level semantic information from the deeper layers. 
% Consequently, we adopt $\{2, 5, 8\}$ as the optimal feature layer configuration for DINOv3 in our final model.





% \textbf{Rationale for Multi-Scale Layer Selection.}
% Given the diverse manifestations of defects—from tiny cracks to large structural missing parts—single-scale features are highly inadequate. We meticulously select features from the 2nd, 5th, and 8th layers of the frozen DINOv3 backbone. As demonstrated in Table \ref{tab:ablation_layers}, this $\{2, 5, 8\}$ configuration yields the best results (99.5\% I-AUC unconditionally). The underlying rationale is complementary: Layer 2 is shallow enough to capture fine-grained textural anomalies and high-frequency noise typical in UltraChip; Layer 5 acts as an intermediary bridge for semantic transitions; Layer 8 is deep enough to capture local structural semantics without becoming too abstract or losing spatial boundary resolution. In contrast, using only deeper layers like $\{5, 8\}$ drops the average I-AUC to 98.30\% due to the loss of fine-grained details.concepts, ensuring holistic anomaly localization.

% % Table : Multi-scale layer selection
% \begin{table}[!ht]
% \centering
% \caption{Performance comparison of multi-scale layer selections on the MVTec AD dataset.}
% \label{tab:ablation_layers}
% \begin{tabular}{c|c|c|c|c}
% \toprule
% Selected Layers & Category & I-AUC & P-AUC & PRO \\
% \midrule
% \multirow{2}{*}{\{5, 8\}} & Average & 98.30 & 97.60 & 95.00 \\
%                           & Cable & 94.79 & 98.78 & 97.40 \\
% \midrule
% \multirow{2}{*}{\textbf{\{2, 5, 8\}}} & Average & \textbf{99.20} & \textbf{99.60} & \textbf{97.40} \\
%                                       & Cable & \textbf{99.50} & \textbf{99.30} & \textbf{99.00} \\
% \bottomrule
% \end{tabular}
% \end{table}





% % 
% \textbf{Superiority of Top-$K$ Score Aggregation.}
% Finally, we evaluate strategies for mapping pixel-level anomaly maps to global image-level scores. In real-world industrial scenarios, background reflections and sensor artifacts often induce isolated high-frequency noise spikes. As demonstrated in Table \ref{tab:ablation_aggregation}, naive Global Max-pooling is highly vulnerable to these single-pixel outliers, severely inflating the false positive rate. Conversely, Global Average-pooling over-smooths the score map, drowning out subtle microscopic defects within dominant normal regions. 

% It is worth noting that before aggregation, our pipeline applies Gaussian smoothing ($\sigma=1.5$) and squared enhancement to suppress high-frequency jitter and amplify salient defect responses. Building on this refined score map, our proposed Top-$K$ Pooling ($K=100$) leverages a rank-based selection mechanism that inherently excludes isolated noise spikes while preserving the spatial density signals from actual defect regions. This robust aggregation strategy achieves the best trade-off between noise suppression and defect sensitivity, maximizing overall detection performance.

% % Table: Score aggregation strategies
% \begin{table}[!ht]
%     \centering
%     \caption{Comparison of image-level score aggregation strategies on MVTec AD. All methods share identical pixel-level preprocessing (Gaussian blur + squared enhancement) before aggregation.}
%     \label{tab:ablation_aggregation}
%     \renewcommand{\arraystretch}{1.2}
%     \begin{tabular}{lccc}
%         \toprule
%         \textbf{Aggregation Strategy} & \textbf{I-AUC} & \textbf{P-AUC} & \textbf{PRO} \\
%         \midrule
%         Global Max-pooling            & 98.9          & 98.8          & 96.2        \\
%         Global Average-pooling        & 98.3          & 99.2          & 95.0        \\
%         \textbf{Top-$K$ Pooling ($K=100$)} & \textbf{99.5} & \textbf{99.1} & \textbf{95.8} \\
%         \bottomrule
%     \end{tabular}
% \end{table}
\section{Experiments}\label{sec4}
\subsection{Experimental Setup}

We evaluate the proposed method on three datasets: MVTec AD\cite{bergmann2019mvtec}, BTAD\cite{mishra2021vt}, and UltraChip\cite{11372587}. MVTec AD is a widely used benchmark containing diverse industrial objects and textures. BTAD includes real-world industrial classes with more challenging backgrounds. UltraChip focuses on microscopic chip defects under noisy imaging conditions.

\paragraph*{Implementation Details.}
We use a frozen DINOv2 backbone and extract intermediate features from the 2nd, 5th, and 8th layers. All input images are resized to $448 \times 448$. We use Adam as the optimizer with a learning rate of 0.0001, batch size 2, and train for 60 epochs. The Gaussian smoothing parameter is set to $\sigma=4$, and Top-K is set to $K=100$ unless otherwise stated. Training and inference are performed on a single NVIDIA V100 GPU with 24GB memory.

\paragraph*{Evaluation Metrics.}
Following standard anomaly detection protocols, we employ three widely-accepted metrics to quantitatively evaluate our model. We use Image-level Area Under the Receiver Operating Characteristic Curve (I-AUC) for anomaly classification, Pixel-level Area Under the ROC (P-AUC) to assess anomaly localization precision, and Per-Region Overlap (PRO) to measure the region-wise overlap rate of the predicted anomalous areas.

\subsection{Comparison with State-of-the-Art Methods}

Table~\ref{tab:mvtec} presents the overall quantitative results on the MVTec AD dataset. Our method achieves consistently competitive performance in terms of image-level AUC, pixel-level AUC, and PRO, demonstrating its effectiveness for both anomaly classification and localization. The detailed results for all 15 object and texture categories are reported in Table~\ref{tab:mvtec_perclass}.

\begin{table}[ht]
\centering
\caption{Comparison on MVTec AD.}
\label{tab:mvtec}
\begin{tabular}{lccc}
\toprule
Method & I-AUC & P-AUC & PRO \\
\midrule
PatchCore\cite{roth2022towards} & 99.2 & 98.1 & 97.3 \\
REB\cite{lyu2024reb} & 99.1 & 98.4 & 92.5 \\
URD\cite{liu2025unlocking} & 98.7 & 98.8 & 96.0 \\
SuperSimpleNet\cite{rolih2024supersimplenet} & 97.4 & 98.5 & 91.0 \\
FUNAD\cite{im2025fun} & 99.2 & 98.1 & 94.2 \\
RD++\cite{tien2023revisiting} & 98.2 & 99.2 & 94.9 \\
FOD\cite{yao2023focus} & 98.9 & 98.3 & 93.5 \\
HGAD\cite{yao2024hierarchical} & 98.4 & 97.9 & 94.2 \\
RAS\cite{yang2024context} & 98.5 & 97.5 & 93.9 \\
MSFR\cite{iqbal2024multi} & 98.4 & 97.3 & 93.0 \\
Dinomaly \cite{guo2025dinomaly} & 99.6 & 98.3 & 94.8 \\
Subspace \cite{lendering2026subspacead} & 99.1 & 98.1 & 94.9 \\
\midrule
\textbf{Ours} & \textbf{99.2} & \textbf{99.6} & \textbf{97.4} \\
\bottomrule
\end{tabular}
\end{table}
\begin{table}[t]
\centering
\caption{Per-class performance on the MVTec AD dataset.}
\label{tab:mvtec_perclass}
\renewcommand{\arraystretch}{1.15}
\begin{tabular}{lccc}
\toprule
Category & I-AUC (\%) & P-AUC (\%) & PRO (\%) \\
\midrule
Bottle      &   100.0   &   99.3   &   97.5   \\
Cable       &   99.5   &    99.3  &    99.0  \\
Capsule     &   97.2   &    99.2  &    97.1  \\
Carpet      &   100.0  &    99.6  &    98.5  \\
Grid        &   100.0  &    99.2  &    96.8  \\
Hazelnut    &   100.0  &    99.3   &   97.0   \\
Leather     &   100.0   &   99.5   &   98.6   \\
Metal Nut   &   100.0   &   98.4   &   94.9   \\
Pill        &   99.6   &    98.9  &    97.9  \\
Screw       &   95.1  &    99.6  &    97.5  \\
Tile        &   100.0   &  98.5    &   95.9   \\
Toothbrush  &   97.5   &   98.8   &    90.1  \\
Transistor  &    99.5  &   98.4   &    95.9  \\
Wood        &   98.2   &   96.1   &    94.0  \\
Zipper      &   100.0   &  98.7    &    96.0  \\
\midrule
Average      &   99.2   &    99.6  &   97.4   \\
\bottomrule
\end{tabular}
\end{table}
Table~\ref{tab:ultrachip} summarizes the results on UltraChip, where severe background noise and subtle defects make localization significantly harder.

\begin{table}[!ht]
\centering
\caption{Comparison on UltraChip.}
\label{tab:ultrachip}
\small % 1. 缩小字号，这是在不改动表头的情况下最有效的办法
\setlength{\tabcolsep}{3pt} % 2. 减小列间距，默认通常是 6pt，这里压缩到 3.5pt
\begin{tabular}{@{}lcccccccccccc@{}}
\toprule
Class & \multicolumn{3}{c}{Four-Lead} & \multicolumn{3}{c}{Bonding} & \multicolumn{3}{c}{Two-Lead} & \multicolumn{3}{c}{Mean} \\
\cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(lr){8-10} \cmidrule(l){11-13}
Method & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO \\
\midrule
REB\cite{lyu2024reb} & 64.0 & 83.2 & 33.9 & 83.2 & 78.5 & 43.6 & 66.1 & 87.3 & 33.2 & 71.1 & 68.3 & 36.9 \\
FUNAD\cite{im2025fun} & 72.5 & 82.5 & 39.0 & 85.1 & 94.8 & 44.5 & 76.4 & 81.4 & 29.5 & 78.0 & 86.2 & 37.6 \\
RAS\cite{yang2024context} & 77.9 & 87.7 & 36.0 & 64.9 & 80.6 & 44.4 & 77.7 & 76.4 & 29.2 & 73.5 & 81.6 & 36.5 \\
MSFR\cite{iqbal2024multi} & 36.7 & 55.4 & 19.6 & 53.6 & 57.4 & 16.4 & 50.1 & 51.5 & 18.5 & 46.8 & 54.8 & 18.1 \\
FOD\cite{yao2023focus} & 79.1 & 80.2 & 32.6 & 79.9 & 89.0 & 54.7 & 79.8 & 74.9 & 18.6 & 79.6 & 81.3 & 35.3 \\
RD++\cite{tien2023revisiting} & 71.9 & 84.7 & 50.8 & 64.2 & 86.1 & 41.4 & 77.7 & 83.9 & 44.7 & 71.2 & 84.9 & 45.6 \\
HGAD\cite{yao2024hierarchical} & 74.3 & 83.5 & 46.6 & 78.1 & 88.8 & 43.1 & 75.8 & 83.2 & 27.5 & 76.0 & 85.1 & 39.1 \\
SuperSimpleNet\cite{rolih2024supersimplenet} & 72.9 & 67.1 & 40.3 & 78.0 & 81.5 & 56.2 & 79.4 & 68.7 & 33.2 & 76.8 & 72.5 & 43.2 \\
URD\cite{liu2025unlocking} & 66.7 & 82.6 & 29.4 & 86.8 & 95.5 & 62.8 & 68.8 & 79.2 & 21.5 & 74.1 & 85.7 & 37.9 \\
Dinomaly\cite{guo2025dinomaly} & 83.9 & 83.9 & 47.6 & 64.9 & 87.6 & 48.1 & 80.3 & 84.6 & 44.4 & 76.4 & 85.4 & 46.7 \\
Subspace\cite{lendering2026subspacead} & 73.5 & 85.5 & 34.1 & 27.6 & 73.1 & 42.9 & 55.7 & 85.3 & 29.6 & 52.3 & 81.3 & 35.5 \\
\textbf{Ours} & \textbf{80.1} & \textbf{84.3} & \textbf{45.7} & \textbf{82.5} & \textbf{92.3} & \textbf{58.9} & \textbf{83.3} & \textbf{82.2} & \textbf{34.6} & \textbf{81.9} & \textbf{86.3} & \textbf{46.4} \\
\botrule
\end{tabular}
\end{table}
Table~\ref{tab:btad} summarizes the results on BTAD, where severe background noise and subtle defects make localization significantly harder.
\begin{table}[ht] 
\centering
\caption{Quantitative comparison on the BTAD dataset per class.}
\label{tab:btad}
% 1. 缩小字体为注脚大小 (也可以尝试 \small)
\footnotesize 
% 2. 减小列间距，默认通常是 6pt，这里改为 3pt 或 4pt
\setlength{\tabcolsep}{3.5pt} 
\begin{tabular}{c|ccc|ccc|ccc|ccc}
\hline
Class & \multicolumn{3}{c|}{01} & \multicolumn{3}{c|}{02} & \multicolumn{3}{c|}{03} & \multicolumn{3}{c}{Average} \\
\hline
Method & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO & I-AUC & P-AUC & PRO \\
\hline
FOD\cite{yao2023focus} & 95.8 & 97.0 & 62.2 & 96.2 & 97.8 & 65.4 & 96.0 & 97.7 & 99.0 & 96.0 & 97.5 & 75.5 \\
Subspace\cite{lendering2026subspacead} & 100 & 98.9 & 84.7 & 91.2 & 96.8 & 80.4 & 99.6 & 98.5 & 56.1 & 96.9 & 98.0 & 73.7 \\
Dinomaly\cite{guo2025dinomaly} & 96.4 & 97.2 & 74.0 & 89.1 & 96.5 & 56.6 & 99.8 & 99.8 & 99.3 & 95.1 & 97.9 & 76.6 \\
REB\cite{lyu2024reb} & 99.6 & 94.7 & 70.0 & 88.5 & 95.6 & 66.4 & 99.8 & 99.7 & 80.6 & 96.0 & 97.2 & 72.4 \\
HGAD\cite{yao2024hierarchical} & 92.6 & 94.9 & 70.5 & 93.3 & 96.7 & 59.3 & 97.0 & 99.1 & 97.9 & 94.1 & 96.9 & 75.9 \\
RAS\cite{yang2024context} & 92.7 & 96.9 & 70.3 & 92.3 & 94.7 & 55.5 & 99.1 & 99.0 & 99.0 & 94.7 & 97.0 & 74.9 \\
\textbf{Ours} & \textbf{99.4} & \textbf{97.1} & \textbf{72.6} & \textbf{93.4} & \textbf{97.5} & \textbf{62.3} & \textbf{100.0} & \textbf{99.7} & \textbf{98.8} & \textbf{97.6} & \textbf{98.1} & \textbf{77.9} \\
\hline
\end{tabular}
\end{table}


\subsection{Ablation Study}

To comprehensively evaluate the effectiveness of the proposed framework, we conduct ablation studies on the Mvtec AD dataset from three perspectives: (1) the contribution of each proposed component, (2) the effectiveness of the selected multi-scale feature layers, and (3) the influence of different image-level score aggregation strategies. Unless otherwise specified, all experiments are conducted under identical training settings.

\begin{table}[t]
\centering
\caption{Ablation study on key components.}
\label{tab:ablation}
\begin{tabular}{lcccc}
\toprule
HMP & Jitter & Unmasked Attention & I-AUC & P-AUC \\
\midrule
 &  &   & 97.6 & 98.5 \\
\checkmark &  &  & 98.9 & 98.6 \\
\checkmark &  & \checkmark & 99.1 & 99.0 \\
\checkmark & \checkmark & \checkmark & 99.2 & 99.6 \\
\bottomrule
\end{tabular}
\end{table}
\textbf{Rationale for Multi-Scale Layer Selection.}
Given the diverse manifestations of defects—from tiny cracks to large structural missing parts—single-scale features are highly inadequate. We meticulously select features from the 2nd, 5th, and 8th layers of the frozen DINOv2 backbone. As demonstrated in Table \ref{tab:ablation_layers}, this $\{2, 5, 8\}$ configuration yields the best results (99.5\% I-AUC unconditionally). The underlying rationale is complementary: Layer 2 is shallow enough to capture fine-grained textural anomalies and high-frequency noise typical in UltraChip; Layer 5 acts as an intermediary bridge for semantic transitions; Layer 8 is deep enough to capture local structural semantics without becoming too abstract or losing spatial boundary resolution. In contrast, using only deeper layers like $\{5, 8\}$ drops the average I-AUC to 98.30\% due to the loss of fine-grained details.concepts, ensuring holistic anomaly localization.
\noindent
As demonstrated in Table~\ref{tab:ablation_screw}, we conducted an ablation study to evaluate the impact of different feature layer combinations from DINOv2 on anomaly detection performance for the \textit{screw} category. 
The configuration utilizing layers $\{2, 5, 8\}$ achieves the highest I-AUC (95.2\%) and PRO (95.8\%), while maintaining a competitive P-AUC (99.2\%). 
Although the $\{3, 6, 9\}$ setting yields a marginally superior P-AUC (99.3\%), it suffers from a noticeable degradation in image-level discrimination (I-AUC drops by 1.3\%). 
We attribute the superior overall performance of layers $\{2, 5, 8\}$ to their balanced representation: this specific combination effectively captures fine-grained shallow texture and structural details from the early layers, while simultaneously preserving rich high-level semantic information from the deeper layers. 
Consequently, we adopt $\{2, 5, 8\}$ as the optimal feature layer configuration for DINOv2 in our final model.

% Table : Multi-scale layer selection
\begin{table}[t]
\centering
\caption{Performance comparison of multi-scale layer selections on the MVTec AD dataset.}
\label{tab:ablation_layers}
\renewcommand{\arraystretch}{1.15}
\begin{tabular}{l l c c c}
\toprule
Selected Layers & Category & I-AUC & P-AUC & PRO \\
\midrule
\{5, 8\}      & Average & 98.30 & 97.60 & 95.00 \\
\{5, 8\}      & Cable   & 94.79 & 98.78 & 97.40 \\
\midrule
\textbf{\{2, 5, 8\}} & Average & \textbf{99.20} & \textbf{99.60} & \textbf{97.40} \\
\textbf{\{2, 5, 8\}} & Cable   & \textbf{99.50} & \textbf{99.30} & \textbf{99.00} \\
\bottomrule
\end{tabular}
\end{table}
\noindent
As demonstrated in Table~\ref{tab:ablation_screw}, we conducted an ablation study to evaluate the impact of different feature layer combinations from DINOv2 on anomaly detection performance for the \textit{screw} category. 
The configuration utilizing layers $\{2, 5, 8\}$ achieves the highest I-AUC (95.2\%) and PRO (95.8\%), while maintaining a competitive P-AUC (99.2\%). 
Although the $\{3, 6, 9\}$ setting yields a marginally superior P-AUC (99.3\%), it suffers from a noticeable degradation in image-level discrimination (I-AUC drops by 1.3\%). 
We attribute the superior overall performance of layers $\{2, 5, 8\}$ to their balanced representation: this specific combination effectively captures fine-grained shallow texture and structural details from the early layers, while simultaneously preserving rich high-level semantic information from the deeper layers. 
Consequently, we adopt $\{2, 5, 8\}$ as the optimal feature layer configuration for DINOv2 in our final model.
\begin{table}[!ht]
    \centering
    \caption{Ablation study on feature layer selection for the \textit{screw} category.}
    \label{tab:ablation_screw}
    \renewcommand{\arraystretch}{1.2} % 增加行高，使表格更易读
    \begin{tabular}{cccc}
        \toprule
        \textbf{Feature Layers} & \textbf{I-AUC} & \textbf{P-AUC} & \textbf{PRO} \\
        \midrule
        $\{3, 6, 9\}$           & 93.9          & \textbf{99.3} & 95.6 \\
        $\{4, 7, 10\}$          & 92.7          & 99.2          & 95.7 \\
        $\{2, 5, 8\}$           & \textbf{95.2} & 99.2          & \textbf{95.8} \\
        \bottomrule
    \end{tabular}
\end{table}


\textbf{Superiority of Top-$K$ Score Aggregation.}
Finally, we evaluate strategies for mapping pixel-level anomaly maps to global image-level scores. In real-world industrial scenarios, background reflections and sensor artifacts often induce isolated high-frequency noise spikes. As demonstrated in Table \ref{tab:ablation_aggregation}, naive Global Max-pooling is highly vulnerable to these single-pixel outliers, severely inflating the false positive rate. Conversely, Global Average-pooling over-smooths the score map, drowning out subtle microscopic defects within dominant normal regions. 

It is worth noting that before aggregation, our pipeline applies Gaussian smoothing ($\sigma=4$) and squared enhancement to suppress high-frequency jitter and amplify salient defect responses. Building on this refined score map, our proposed Top-$K$ Pooling ($K=100$) leverages a rank-based selection mechanism that inherently excludes isolated noise spikes while preserving the spatial density signals from actual defect regions. This robust aggregation strategy achieves the best trade-off between noise suppression and defect sensitivity, maximizing overall detection performance.

% Table: Score aggregation strategies
\begin{table}[!ht]
    \centering
    \caption{Comparison of image-level score aggregation strategies on MVTec AD. All methods share identical pixel-level preprocessing (Gaussian blur + squared enhancement) before aggregation.}
    \label{tab:ablation_aggregation}
    \renewcommand{\arraystretch}{1.2}
    \begin{tabular}{lccc}
        \toprule
        \textbf{Aggregation Strategy} & \textbf{I-AUC} & \textbf{P-AUC} & \textbf{PRO} \\
        \midrule
        Global Max-pooling            & 98.9          & 98.8          & 96.2        \\
        Global Average-pooling        & 98.3          & 99.2          & 95.0        \\
        \textbf{Top-$K$ Pooling ($K=100$)} & \textbf{99.2} & \textbf{99.6} & \textbf{97.4} \\
        \bottomrule
    \end{tabular}
\end{table}



\subsection{Efficiency Analysis}
To further validate the practicality of our method, we compare its computational efficiency with two representative IAD frameworks from different methodological paradigms. Specifically, PatchCore~\cite{roth2022towards}, a widely adopted memory-bank-based method, is selected as the representative retrieval paradigm, while Dinomaly~\cite{guo2025dinomaly}, a recent state-of-the-art reconstruction-based approach, represents feature reconstruction methods. These two methods have demonstrated strong performance in the literature and therefore provide meaningful baselines for evaluating the trade-off between accuracy and efficiency.

Table~\ref{tab:efficiency} reports the number of parameters, FLOPs, inference speed, and GPU memory consumption in Mvtec AD. Compared with PatchCore, our method introduces a lightweight reconstruction module built upon stronger semantic representations, resulting in higher computational complexity but substantially improved anomaly localization capability on challenging industrial scenarios. Compared with Dinomaly, our method requires fewer parameters (112.34M vs. 132.8M), reduces GPU memory consumption by nearly 78\%, and achieves a higher inference speed (18.92 FPS vs. 15 FPS), while maintaining competitive computational complexity. These results demonstrate that our framework provides a favorable balance between detection performance and deployment efficiency, making it well suited for complex industrial inspection tasks.

\begin{table}[t]
\centering
\caption{Efficiency comparison.}
\label{tab:efficiency}
\begin{tabular}{lcccc}
\toprule
Method & Params & FLOPs & FPS & GPU Mem. \\
\midrule
PatchCore\cite{roth2022towards} & 68.9M & 11.4 G & 11 & 1593MB\\
Dinomaly\cite{guo2025dinomaly} &  132.8M & 104.7G & 15  & 11726MB\\
Ours & \textit{112.34M} & \textit{107.84G} & \textit{18.92} & \textit{2611MB} \\
\bottomrule
\end{tabular}
\end{table}

\subsection{Qualitative Results}

Furthermore, as illustrated by the representative anomaly localization examples on MvTec AD in Figure~\ref{fig:mvtec_vis}, the generated anomaly maps precisely highlight defect regions while suppressing background noise. This capability is demonstrated even more clearly in the qualitative results in Figure~\ref{fig:ultrachip_vis}; here, our framework precisely pinpoints actual defect areas without being inundated by widespread false-positive background noise (successfully avoiding massive "red" regions), thereby proving its exceptional robustness in extracting intrinsic normal patterns within highly non-ideal and noisy industrial environments.

\begin{figure}[!htbp]
    \centering
    \includegraphics[width=\linewidth]{mvtec_vis.png}
    \caption{Qualitative results on Mvtec AD.}
    \label{fig:mvtec_vis}
\end{figure}
\begin{figure}[!htbp]
    \centering
    \includegraphics[width=\linewidth]{fig6.png}
    \caption{Qualitative results on UltraChip.}
    \label{fig:ultrachip_vis}
\end{figure}





\section{Conclusion}\label{sec5}

Although the proposed framework is simple and effective, it has several limitations. First, it still relies on a pretrained DINOv2 backbone, so the absolute efficiency advantage should be interpreted relative to reconstruction-heavy anomaly detectors rather than to the backbone itself. Second, performance on UltraChip is lower than on MVTec AD, indicating that severe microscopic noise remains challenging. Third, the current model is trained in a class-specific setting, which limits deployment in multi-class industrial scenarios.

These observations suggest several future directions: reducing dependence on backbone capacity, designing more adaptive fusion weights, and extending the framework to a unified multi-class setting.


\section*{Declarations}

\subsection*{Availability of data and material}
The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.
% 如果数据已公开，请替换为：The dataset is available at [Repository Name] under DOI: [xxx].

\subsection*{Competing interests}
The authors declare that they have no competing interests.
% 如果有利益冲突，请如实声明，例如：Author A is a consultant for Company B.

\subsection*{Funding}
The authors did not receive support from any organization for the submitted work.
% 如果没有资助，请写：The authors did not receive support from any organization for the submitted work.

\subsection*{Authors' contributions}
Chaoqun Wang: Conceptualization, Methodology, Formal Analysis, Writing -- Original Draft, Project Administration. 
Wenjing Zhang: Validation, Investigation, Data Curation, Writing -- Review \& Editing. 
Bo Qi: Resources, Visualization. 
Xiaoyu Huang: Resources, Visualization. 
Ning He: Supervision, Funding Acquisition, Final Approval. 
All authors read and approved the final manuscript.
\subsection{Acknowledgments}
This work was supported by the Key Research and Development Project of the Ministry of Science and Technology: Ultrasonic Microscope (2023YFF0716500) 



\bibliography{sn-bibliography}% common bib file
%% if required, the content of .bbl file can be included here once bbl is generated
%%\input sn-article.bbl

\end{document}
